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

Error is Angular universal SSR build #39

Open
saurabh-innovator opened this issue Nov 3, 2020 · 2 comments
Open

Error is Angular universal SSR build #39

saurabh-innovator opened this issue Nov 3, 2020 · 2 comments

Comments

@saurabh-innovator
Copy link

On running the command for server-side rendering: ng run project-name:server:production

Getting the following error:

ERROR in ./node_modules/swarm-js/node_modules/got/index.js
Module not found: Error: Can't resolve './package' in 'Project-path\node_modules\swarm-js\node_modules\got'

ERROR in ./node_modules/swarm-js/node_modules/got/index.js
Module not found: Error: Can't resolve 'electron' in 'Project-path\node_modules\swarm-js\node_modules\got'

I'm using the Angular 10 and windows system.

Introspecting further I reached to below two conclusions:

One of the libraries is trying to require package.json file using the below command
const pkg = require('./package');
We are using a library that uses a conditional require statement which tries to require electron if the condition fulfills.
In the first case, the SSR build is unable to require package.json if the extension is not mentioned.
In the second case, SSR build is trying to resolve the conditional require statements as well.

Please help in resolving this issue by upgrading the version of got to lastest as they have resolved this issue in their latest version.

@mshubhamtyagi
Copy link

I am also facing the same issue. Please look into this.

@Singtah
Copy link

Singtah commented Aug 2, 2021

same issue here. Any updates ?

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

3 participants