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

Resolving sub-dependencies fails for some packages #45

Closed
tomraithel opened this issue Jun 6, 2018 · 2 comments
Closed

Resolving sub-dependencies fails for some packages #45

tomraithel opened this issue Jun 6, 2018 · 2 comments

Comments

@tomraithel
Copy link

For some npm packages (I have not yet figured out why) the build fails when it tries to resolve transitive dependencies. This happens for example with googleapis.

Here is my ember-cli-build.js:

app.import('node_modules/googleapis/build/src/index.js', {
  using: [{ transformation: 'cjs', as: 'googleapis' }],
});

Here is the error output:



Unexpected token

...
'fs' is imported by node_modules/google-auth-library/build/src/auth/googleauth.js, but could not be resolved – treating it as an external dependency
'fs' is imported by commonjs-external:fs, but could not be resolved – treating it as an external dependency
'url' is imported by commonjs-external:url, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/lru-cache/index.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/google-auth-library/build/src/auth/googleauth.js, but could not be resolved – treating it as an external dependency
'util' is imported by commonjs-external:util, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/google-auth-library/build/src/auth/oauth2client.js, but could not be resolved – treating it as an external dependency
'stream' is imported by commonjs-external:stream, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/jws/lib/sign-stream.js, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/jws/lib/verify-stream.js, but could not be resolved – treating it as an external dependency
'stream' is imported by node_modules/jws/lib/data-stream.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/jws/lib/sign-stream.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/jws/lib/verify-stream.js, but could not be resolved – treating it as an external dependency
'util' is imported by node_modules/jws/lib/data-stream.js, but could not be resolved – treating it as an external dependency
'fs' is imported by node_modules/gtoken/build/src/index.js, but could not be resolved – treating it as an external dependency
...
and some more...
@Gaurav0
Copy link
Contributor

Gaurav0 commented Jun 21, 2018

These aren't transitive dependencies, these are node builtins. You need to use rollup-plugin-node-builtins as described in the Readme.

@tomraithel
Copy link
Author

Ah - I see. I´ve not seen that. Thank you!

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

2 participants