Skip to content

Conversation

alexanderroidl
Copy link

The recently commited commit 9421ec9 lead to the lib directory not being part of the published package anymore, which results in required files not being found and eventually failure.

For example when building an Angular application:

$ npm run build

> myangularproject@0.0.1 build
> ng build

An unhandled exception occurred: Cannot find module './compile.js'
Require stack:
- C:\Users\alex\Projekte\myangularproject\node_modules\css-select\lib\index.js
- C:\Users\alex\Projekte\myangularproject\node_modules\beasties\dist\index.cjs
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\utils\index-file\inline-critical-css.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\utils\index-file\index-html-generator.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\tools\esbuild\index-html-generator.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\builders\application\execute-post-bundle.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\builders\application\execute-build.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\builders\application\index.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular\build\src\private.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular-devkit\build-angular\src\builders\browser\index.js
- C:\Users\alex\Projekte\myangularproject\node_modules\@angular-devkit\architect\node\node-modules-architect-host.js
See "C:\Users\alex\AppData\Local\Temp\ng-vsSuqp\angular-errors.log" for further details

A dist directory appears to be used to publish:

9421ec9#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R26

But it can not be found in any shape or form inside the repository. There is no reference to such a directory in any file. Is there a build script which has not been pushed yet that fails to export the missing files perhaps?

},
"files": [
"dist",
"src"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To deliver the source code to users Git/GitHub should be used. The source files should not exported for a NPM publish.

"import": "./lib/esm/index.js"
},
"files": [
"dist",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dist directory does not exist and can not be built right now as there is no build script for it.

"format:prettier": "npm run prettier -- --write",
"prettier": "prettier '**/*.{ts,md,json,yml}'",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/css-select/$(git rev-parse HEAD)/src/",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The URL needs to be wrapped in quotation marks to function in Windows+Git Bash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant