-
Notifications
You must be signed in to change notification settings - Fork 214
Neutrino won't build in production environment #1504
Comments
Hi! Sorry to hear you've been encountering errors. I suspect this might be fixed in the Neutrino 9 release, which is currently in release candidate and will be released very soon (ie is pretty stable, so I'd recommend using it now even though it's pre-release). For details on how to upgrade, see: #1129 |
I'm trying to upgrade to neutrino 9 but still have issues. When I do yarn start or yarn build I have an error that told me that can't find @babel/preset-env:
Here's my .neutrinorc.js file:
Someone know how to solve this problem please ? Thank you! |
I would remove these lines, they should not be needed any more: babel: {
// options: {
// blacklist: ["useStrict"],
// },
presets: [
['babel-preset-env', {
modules: false,
useBuiltIns: true,
StrictMode: false,
// exclude: ['transform-regenerator', 'transform-async-to-generator'],
}]
]
}, Unrelated to the error: Also |
Ok apparently it solve this problem, but I have other problems now. When I do a yarn build, all my modules from my node_modules folder are not found. And when I a do a yarn start I have this error:
|
@AliHammami hi! Debugging webpack specific issues is probably out of scope for here (since the errors are due to custom config you've added that is getting passed to webpack/its plugins and causing it to break - and isn't a bug in the Neutrino preset itself), but happy to have one last attempt...
I would remove this line: neutrino.config.resolve.modules.add(neutrino.options.source);
This sounds like one of the options passed to In general your |
Hey thank you @edmorley for taking the time to help me! I'm not the one who config this. I'm a junior who taking over on this project. This is the first time I work with neutrino and the one who config this, is no longer working with the company and I'm on my own to solve this problem. The config is really complex and I don't understand everything in it. I did what you asked me, I don't have those problems anymore but now I have this 2 errors;
Here is my index.jsx file:
Thanks again for your help! |
Ah sorry to hear that. I'll see if I can help.
I believe they are due to the removal of the line: neutrino.config.resolve.modules.add(neutrino.options.source); ...because the project is using absolute imports (ie Your options are to:
I personally would go with (2), since I find fake absolute paths to be confusing when reading the source for a project -- it makes it much harder to tell what are external packages being imported, vs local files belonging to the project. |
Also to understand how webpack resolves (ie finds the intended target) of an import, see: |
Thank you @edmorley for your help! And yes that's what I did, I have changed all my path and now the app is compiled successfully but now I have a problem where I'm stuck. I can go to my home page but for the other pages I have this error:
It seems to be a problem with my import, but everything worked fine before the update. |
Hello,
I'm trying to build in production environment but I have this error :
`<--- Last few GCs --->
[12141:0x3ea4060] 304886 ms: Scavenge 1896.0 (2065.1) -> 1881.3 (2065.6) MB, 17.1 / 0.0 ms (average mu = 0.283, current mu = 0.314) allocation failure
[12141:0x3ea4060] 305063 ms: Scavenge 1896.5 (2065.6) -> 1882.4 (2066.6) MB, 19.5 / 0.0 ms (average mu = 0.283, current mu = 0.314) allocation failure
[12141:0x3ea4060] 305266 ms: Scavenge 1897.2 (2066.6) -> 1883.4 (2067.6) MB, 18.9 / 0.0 ms (average mu = 0.283, current mu = 0.314) allocation failure
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x2d8b285408a1
1: /* anonymous */ [0x2497867af89] [/var/www/html/whire/whire-client/node_modules/babel-traverse/lib/index.js:~94] [pc=0xf8abea5b812](this=0x3f8e3ab1b299 <JSFunction traverse (sfi = 0x186b46c72a89)>,0x15048d5da901 ,0x1801c9dc0cc1 ,0x189fe8e5add1 ,0x285b9c8c04a9 ,0...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
Writing Node.js report to file: report.20191213.152251.12141.0.001.json
Node.js report completed
1: 0x9da7c0 node::Abort() [/usr/local/bin/node]
2: 0x9db976 node::OnFatalError(char const*, char const*) [/usr/local/bin/node]
3: 0xb39f1e v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
4: 0xb3a299 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/usr/local/bin/node]
5: 0xce5635 [/usr/local/bin/node]
6: 0xce5cc6 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
7: 0xcf1b5a v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/usr/local/bin/node]
8: 0xcf2a65 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
9: 0xcf5478 v8::internal::Heap::AllocateRawWithRetryOrFail(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [/usr/local/bin/node]
10: 0xcbbda7 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType) [/usr/local/bin/node]
11: 0xff1e0b v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
12: 0x1374fd9 [/usr/local/bin/node]
Aborted
`
Everything works fine in staging and development environment but in production environment it won't build.
Here's my package.json:
Do you know where the problem might come from ? Thank you
Bug or issue?
Please try to answer the following questions:
The text was updated successfully, but these errors were encountered: