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

You may need an appropriate loader to handle this file type. #2934

Open
thidasapankaja opened this issue Jul 1, 2020 · 8 comments
Open

You may need an appropriate loader to handle this file type. #2934

thidasapankaja opened this issue Jul 1, 2020 · 8 comments

Comments

@thidasapankaja
Copy link

Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.

Description

In the production build, it gives an error You may need an appropriate loader to handle this file type. on npm run build

Expected behavior
run the build smoothly as the dev build

Screenshots
If applicable, add screenshots to help explain your problem.

Versions

  • React-Boilerplate: 4.0.0
  • Node : v10.21.0
  • NPM : 6.14.4
  • Browser: Chrome
ERROR in ./app/app.js 84:12
Module parse failed: Unexpected token (84:12)
You may need an appropriate loader to handle this file type.
| if (!window.Intl) {
|   new Promise(function (resolve) {
>     resolve(import('intl'));
|   }).then(function () {
|     return Promise.all([import('intl/locale-data/jsonp/en.js'), import('intl/locale-data/jsonp/de.js')]);
 @ multi ./node_modules/react-app-polyfill/ie11.js ./app/app.js ./app/silent/index.js main[1]
Child html-webpack-plugin for "index.html":
     1 asset
    Entrypoint undefined = index.html
Child html-webpack-plugin for "silent.html":
     1 asset
    Entrypoint undefined = silent.html
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! react-boilerplate@4.0.0 build: `cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the react-boilerplate@4.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above

This's the error I'm getting during the npm run build process on production

This's the build command in my package.json

"build": "cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout",

How can I get this fixed ?

@dianhan8
Copy link

dianhan8 commented Aug 4, 2020

same problem with me!

@leonardoampuero
Copy link

leonardoampuero commented Sep 2, 2020

Same issue here when running npm start
As far as I remember when it happened I removed the node_modules and re-intalled all. But I want to understand why it stops working.

@leonardoampuero
Copy link

@thidasapankaja @dianhan8 I fixed the issue downgrading webpack to "webpack": "4.28.4"

webpack/webpack#8656

@dianhan8
Copy link

dianhan8 commented Sep 3, 2020

thank you 👍

@thidasapankaja
Copy link
Author

Thank you @leonardoampuero !

@sophyphreak
Copy link

So running npm install was what fixed this for me, as frustrating as that is.

@gabrielmvas
Copy link

Anyone knows how to fix this? None of the solutions worked

@sophyphreak
Copy link

React Boilerplate hasn't been updated since 2019. I wouldn't use it for a modern project if you can avoid it.

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

5 participants