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

error in webpack and babel #21

Open
gasner opened this issue Apr 12, 2018 · 4 comments
Open

error in webpack and babel #21

gasner opened this issue Apr 12, 2018 · 4 comments

Comments

@gasner
Copy link

gasner commented Apr 12, 2018

I get this error:

ERROR in ./node_modules/postal-codes-js/formats/US.json
Module parse failed: Unexpected token  in JSON at position 0
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token  in JSON at position 0

this is my module:

module: {
		rules: [
			{test: /\.js$/, exclude: /node_modules/, loader: "babel-loader"},
			{test: /\.vue$/, loader: "vue-loader"},
			{test: /\.css$/, use: [{loader: "style-loader"}, {loader: "css-loader"}]},
			{test: /\.html$/, loader: "html-loader"},
			{test: /\.jpg$/, loader: "file-loader"},
			{test: /\.png$/, loader: "url-loader?mimetype=image/png"},
			{test: /\.(woff|woff2)$/, loader: "url-loader?limit=10000&mimetype=application/font-woff"},
			{test: /\.ttf$/, loader: "file-loader"},
			{test: /\.eot$/, loader: "file-loader"},
			{test: /\.svg$/, loader: "file-loader"},
		]
	},
 "babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.6.1",

"webpack": "^4.2.0",

@lpuccini
Copy link

We also have problems with webpack and babel, we cannot compile.
With similar settings

 "@babel/core": "7.0.0-beta.46",
    "@babel/plugin-proposal-class-properties": "7.0.0-beta.46",
    "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.46",
    "@babel/plugin-syntax-dynamic-import": "7.0.0-beta.46",
    "@babel/plugin-transform-classes": "7.0.0-beta.46",
    "@babel/plugin-transform-destructuring": "7.0.0-beta.46",
    "@babel/plugin-transform-react-constant-elements": "7.0.0-beta.46",
    "@babel/plugin-transform-react-display-name": "7.0.0-beta.46",
    "@babel/plugin-transform-regenerator": "7.0.0-beta.46",
    "@babel/plugin-transform-runtime": "7.0.0-beta.46",
    "@babel/preset-env": "7.0.0-beta.46",
    "@babel/preset-flow": "7.0.0-beta.46",
    "@babel/preset-react": "7.0.0-beta.46",
    "babel-plugin-macros": "2.2.1",
    "babel-plugin-transform-dynamic-import": "2.0.0",
    "babel-plugin-transform-react-remove-prop-types": "0.4.13"

when building we got:

Creating an optimized production build...
Failed to compile.

Failed to minify the code from this file: 

     ./node_modules/postal-codes-js/postal-codes.js:7 

Read more here: http://bit.ly/2tRViJ9

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `rm -rf build && react-scripts 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/2018-09-10T12_21_46_979Z-debug.log
The command '/bin/sh -c npm run build' returned a non-zero code: 1
Exited with code 1

@joeyfigaro
Copy link

Same issues. Lib is unusable if you're using a copy of react-scripts that is pre 2.0

@alessandrocentanni
Copy link

Still having same issue, is this going to be fixed anytime soon?

@ozankaya
Copy link
Contributor

Can you please list the steps for reproducing this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants