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

Cannot build on production and on Jenkins #533

Open
alagane opened this issue Mar 8, 2022 · 3 comments
Open

Cannot build on production and on Jenkins #533

alagane opened this issue Mar 8, 2022 · 3 comments
Assignees

Comments

@alagane
Copy link
Member

alagane commented Mar 8, 2022

When building for production, or with Jenkins, there is an error. It might be linked to https://github.com/linagora/jmap-client-ts
The jmap-client-ts directory inside node_modules does not contain the lib directory on production.

I was not able to reproduce the error locally, using the same npm 6.14.6 and node 12.18.3. Locally the jmaps-client-ts directory contains the lib directory.

ERROR in ./src/esn.inbox.libs/app/services/jmap-client-provider/jmap-client-provider.js
Module not found: Error: Can't resolve 'jmap-client-ts/lib' in '/app/src/esn.inbox.libs/app/services/jmap-client-provider'
 @ ./src/esn.inbox.libs/app/services/jmap-client-provider/jmap-client-provider.js 17:15-44
 @ ./src/esn.inbox.libs/app/app.module.js
 @ ./src/app/app.js
 @ ./src/index.js

ERROR in ./src/esn.inbox.libs/app/services/jmap-client-provider/jmap-client-provider.js
Module not found: Error: Can't resolve 'jmap-client-ts/lib/utils/fetch-transport' in '/app/src/esn.inbox.libs/app/services/jmap-client-provider'
 @ ./src/esn.inbox.libs/app/services/jmap-client-provider/jmap-client-provider.js 20:16-67
 @ ./src/esn.inbox.libs/app/app.module.js
 @ ./src/app/app.js
 @ ./src/index.js
@alagane
Copy link
Member Author

alagane commented Mar 10, 2022

Possible fix:
Remove the file restriction on package.json on jmap-client-ts (instead on using only lib)
Using a postinstall script on jmap-client-ts to build the project
Adding typescript dependency to esn-frontend-inbox to be able to build jmap-client-ts with the correct version

alagane added a commit to alagane/jmap-client-ts that referenced this issue Mar 11, 2022
alagane added a commit to alagane/jmap-client-ts that referenced this issue Mar 11, 2022
alagane added a commit to alagane/esn-frontend-inbox that referenced this issue Mar 11, 2022
alagane added a commit to alagane/jmap-client-ts that referenced this issue Mar 11, 2022
alagane added a commit to alagane/jmap-client-ts that referenced this issue Mar 11, 2022
alagane added a commit to alagane/jmap-client-ts that referenced this issue Mar 11, 2022
alagane added a commit to alagane/jmap-client-ts that referenced this issue Mar 11, 2022
@alagane
Copy link
Member Author

alagane commented Mar 11, 2022

See npm/cli#2062

@alagane
Copy link
Member Author

alagane commented Mar 11, 2022

The problems is the prepare script of jmap-client-ts is not run, this is clearly a npm bug
Tried with npm 7.24.2 with different node versions :

  • With node 10.24.1 ✔️
  • With node 12.19.0 ✔️
  • With node 14.19.0 ✔️

alagane added a commit to alagane/esn-frontend-inbox that referenced this issue Mar 15, 2022
alagane added a commit to alagane/esn-frontend-inbox that referenced this issue Mar 17, 2022
alagane added a commit to alagane/esn-frontend-inbox that referenced this issue Mar 17, 2022
alagane added a commit to alagane/esn-frontend-inbox that referenced this issue Mar 17, 2022
alagane added a commit to alagane/esn-frontend-inbox that referenced this issue Apr 12, 2022
alagane added a commit that referenced this issue Apr 12, 2022
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