question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Build is failing due to Babel

See original GitHub issue

‘yarn start’ works ‘yarn build’ fails

` Error: Trace: { code: ‘MODULE_NOT_FOUND’ } at init.catch.e (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\bin\react- static:6:11) at process._tickCallback (internal/process/next_tick.js:68:7)

Error: Cannot find module ‘F:\OneDrive\Web Development\Development Work\TypeScript\my-static -site\artifacts\static-app.js’

  • loader.js:636 Function.Module._resolveFilename`

even more

ERROR in F:/OneDrive/Web Development/Development Work/TypeScript/my-static-site/artifacts/react-static-templates.js Module build failed (from ./babel-loader/lib/index.js): TypeError: Property value expected type of string but got null at Object.validate (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\types\lib\definitions\utils.js:164:13) at validateField (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\types\lib\validators\validate.js:22:9) at validate (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\types\lib\validators\validate.js:16:3) at builder (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\types\lib\builders\builder.js:46:27) at Object.StringLiteral (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\types\lib\builders\generated\index.js:337:31) at idOption (F:\OneDrive\Web Development\Development Work\TypeScript\my-static-site\node_modules\babel-plugin-universal-import\index.js:134:49) at PluginPass.Import (F:\OneDrive\Web Development\Development Work\TypeScript\my-static-site\node_modules\babel-plugin-universal-import\index.js:241:13) at newFn (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\traverse\lib\visitors.js:195:21) at NodePath._call (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\traverse\lib\path\context.js:53:20) at NodePath.call (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\traverse\lib\path\context.js:40:17) at NodePath.visit (C:\Users\robih\AppData\Roaming\npm\node_modules\react-static\node_modules\@babel\traverse\lib\path\context.js:88:12)

i have tried removing yarn.lock, ‘yarn’, ‘yarn upgrade’, ‘yarn upgrade react-static’

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
robiharidcommented, Sep 25, 2019

Same as #1307 (comment), I think there is a bug in the basic template. Is that the one you used? If that’s the case, I’ll try to reproduce and fix 😃

Thanks bud! Yes I used both basic and the typescript template (react-static-typescript-plugin), I came across your comment yesterday…

if it helps I am on react-static v7.2.2 but the package.json says ^7.2.0 (i think the caret upgrades to latest minor version)

when i use --debug i get warnings and then a final error about babel

1reaction
SleeplessBytecommented, Sep 25, 2019

Same as https://github.com/react-static/react-static/issues/1307#issuecomment-532696446, I think there is a bug in the basic template. Is that the one you used? If that’s the case, I’ll try to reproduce and fix 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel error causing builds to fail · Issue #37080
Solution in my case was to use the yarn resolutions to pin some babel deps to latest pre-7.18 versions. Can't give you a...
Read more >
Ask Question
I have searched through the internet to solve it but it still shows the same error. This is the error I am getting:...
Read more >
Module build failed babel [#3134085]
It compiles the files but i get an error. I used the drush command to build the subtheme.
Read more >
Pipelines build fails when webpack babel processing doesn't ...
The error in your log file indicates that the file isn't being processed as ES6, so the webpack execution fails because of the...
Read more >
node-graphql build failure with current babel (passed with ...
Bug#1004540 : node-graphql build failure with current babel (passed with an older babel) ... This is caused by this patch to load modules...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found