Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Fastboot Dependencies Whitelist breaks node_modules resolution expectations #901

Open
runspired opened this issue Oct 29, 2022 · 0 comments

Comments

@runspired
Copy link
Contributor

runspired commented Oct 29, 2022

the effects of this bug are that fastboot cannot be used in conjunction with more recent versions of yarn, pnpm, or pnp strategies that avoid hoisting dependencies to root.

This affects resolution of whitelisted dependencies both from the project and from addons it consumes.

For instance, ember-fetch declares both a dependency and whitelistes abortcontroller-polyfill. Even if the consuming app also adds abortcontroller-polyfill to its dependencies and adds the same whitelisted values, when hoisting does not occur this will fail to be resolved by the sandboxedRequire provided by fastboot-schema.js which scopes to a directory that will not be able to see it and executes from a directory that does not have the parent project in its path.

Example failure of this in which the parent project has re-declared the dependency and re-declared the whitelisted values:

Error: Cannot find module 'abortcontroller-polyfill/dist/cjs-ponyfill'
Require stack:
- /Users/cthoburn/github/data/node_modules/.pnpm/fastboot@3.3.2/node_modules/fastboot/src/fastboot-schema.js
- /Users/cthoburn/github/data/node_modules/.pnpm/fastboot@3.3.2/node_modules/fastboot/src/ember-app.js
- /Users/cthoburn/github/data/node_modules/.pnpm/fastboot@3.3.2/node_modules/fastboot/src/index.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli-fastboot-testing@0.6.0_webpack@5.74.0/node_modules/ember-cli-fastboot-testing/lib/helpers.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli-fastboot-testing@0.6.0_webpack@5.74.0/node_modules/ember-cli-fastboot-testing/index.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli@4.8.0/node_modules/ember-cli/lib/models/package-info-cache/package-info.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli@4.8.0/node_modules/ember-cli/lib/models/package-info-cache/index.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli@4.8.0/node_modules/ember-cli/lib/models/project.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli@4.8.0/node_modules/ember-cli/lib/utilities/get-config.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli@4.8.0/node_modules/ember-cli/lib/utilities/instrumentation.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli@4.8.0/node_modules/ember-cli/lib/cli/index.js
- /Users/cthoburn/github/data/node_modules/.pnpm/ember-cli@4.8.0/node_modules/ember-cli/bin/ember
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

No branches or pull requests

1 participant