-
Notifications
You must be signed in to change notification settings - Fork 53
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
npm ci
fails in GitLab pipeline context
#141
Comments
Adding the However now the build seems to fail because of a warning message regarding the new > [email protected] build /builds/customerRedacted/magento2/app/code/Hyva/Checkout/reactapp
> react-app-rewired build
Creating an optimized production build...
Treating warnings as errors because process.env.CI = true.
Most CI servers set it automatically.
Failed to compile.
./src/paymentMethods/utility/index.js
Critical dependency: the request of a dependency is an expression
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `react-app-rewired build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2021-08-16T07_56_33_667Z-debug.log |
I have narrowed down the warning blocking compilation to the following lines, in const paymentMethodFile = `../${paymentMethod}/${file}`;
const data = await import(
/* webpackMode: "eager" */ paymentMethodFile
); Looking into the issue it appears to be a longlasting problem (webpack/webpack#196) with regards to dynamic imports, but I dont fully understand how it all works under the hood or why specificly here the warning message pops up for us. // const paymentMethodFile = `../${paymentMethod}/${file}`;
const data = await import(
/* webpackMode: "eager" */ `../${paymentMethod}/${file}`
); results in:
Googling on this error message quickly brought me to an old const data = await import(
// eslint-disable-next-line prefer-template
/* webpackMode: "eager" */ '../' + paymentMethod + '/' + file
); Update: I can confirm our pipeline is working after these changes and using |
This is tricky. We were using But But this is still showing a warning in the console when we build the app. Not sure, how to tackle this situation to be honest. If the javascript concatenation works as you described, then i will change it to that! But still feel it is not a clean solution :( |
There is no warning/error messages showing during the build process at the moment and hence closing this issue. If the issue still persist, feel free to re-open it. |
Using the develop branch with one of the last commits (I included the npm install and package changes from #103 ). Our GitLab pipeline fails to build the checkout due to the previous
npm ci
command failing (which is likenpm install
but doesnt write anything topackage.json
and mostly runs better for automated environments see: https://docs.npmjs.com/cli/v7/commands/npm-ci)We shortly discussed this issue in #103 and between me and @progammer-rkt in slack, but couldnt quite come to a valid solution.
The error is as follows;
Which causes the build to fail because of missing tailwind install (postcss package);
Tested but didnt work;
preinstall
command to name ofpostinstall
Should still test;
npm install
even though it might not be ideal for automated environments--unsafe-perm
seems to work according to certain google results about npm not running in a certainwd
(working directory), see; npm docs, stackoverflow, github issue in npm/npm-lifecycle about dockerized postinstallSince im assigned to a project currently experiencing this issue I will try and debug a solution in the coming week.
The text was updated successfully, but these errors were encountered: