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

webpack error #26

Open
fuxiocteract opened this issue Oct 5, 2016 · 5 comments
Open

webpack error #26

fuxiocteract opened this issue Oct 5, 2016 · 5 comments

Comments

@fuxiocteract
Copy link

when importing lokka-transport-http, getting these errors:

WARNING in .//encoding/lib/iconv-loader.js
Critical dependencies:
9:12-34 the request of a dependency is an expression
@ ./
/encoding/lib/iconv-loader.js 9:12-34

ERROR in .//iconv-lite/encodings/tables/gb18030-ranges.json
Module parse failed: C:\Users\黄硕\Project\toodu\node_modules\iconv-lite\encodings\tables\gb18030-ranges.json Unexpected token (1:9)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (1:9)
at Parser.pp$4.raise (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:2221:15)
at Parser.pp.unexpected (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:603:10)
at Parser.pp.semicolon (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:581:61)
at Parser.pp$1.parseExpressionStatement (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:966:10)
at Parser.pp$1.parseStatement (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:730:24)
at Parser.pp$1.parseBlock (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:981:25)
at Parser.pp$1.parseStatement (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:709:33)
at Parser.pp$1.parseTopLevel (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:638:25)
at Parser.parse (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:516:17)
at Object.parse (C:\Users\黄硕\Project\toodu\node_modules\acorn\dist\acorn.js:3098:39)
@ ./
/iconv-lite/encodings/dbcs-data.js 99:37-76

@fuxiocteract
Copy link
Author

Add a json-loader to webpack and it seems to have solved it for now.

@ljubic
Copy link

ljubic commented Oct 13, 2016

npm install --save-dev json-loader

module: {
    loaders: [
      { test: /\.json$/, loader: "json-loader" }
    ]
}

@machineghost
Copy link

machineghost commented Nov 26, 2016

It would be nice if the instruction line on the front page:

 npm i --save lokka lokka-transport-http

could be changed to reflect this:

npm i --save lokka lokka-transport-http

#  For Webpack users only
npm i --save-dev json-loader

# NOTE: You will also need to add a module.loaders entry for the loader to webpack.config:
module: {
    loaders: [
        {loader: 'json', test: /\.json$/},
    ]
}

@arunoda
Copy link
Contributor

arunoda commented Nov 26, 2016

@machineghost could you send me a PR for that.

@lanwin
Copy link

lanwin commented Apr 13, 2017

The problem is this dosnt help when using create-react-app.

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