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

installation with webpack fails #70

Closed
torstenrudolf opened this issue May 2, 2017 · 5 comments · Fixed by #96
Closed

installation with webpack fails #70

torstenrudolf opened this issue May 2, 2017 · 5 comments · Fixed by #96

Comments

@torstenrudolf
Copy link

Hi all, I dont know much abourt webpack and babel, but I'm using it for a while and this is the first time i encounter a problem.

Packaging draft-convert 1.4.3 works fine, but since 1.4.4-1.4.6 I get the following webpack error. Do I need to configure a babel loader to get it working? Any hint how to get it working is much appreciated!

ERROR in ./~/draft-convert/package.json
Module parse failed: <somePath>/frontendClient/resources/node_modules/draft-convert/package.json Unexpected token (2:9)
You may need an appropriate loader to handle this file type.
SyntaxError: Unexpected token (2:9)
    at Parser.pp$4.raise (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:2221:15)
    at Parser.pp.unexpected (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:603:10)
    at Parser.pp.semicolon (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:581:61)
    at Parser.pp$1.parseExpressionStatement (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:966:10)
    at Parser.pp$1.parseStatement (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:730:24)
    at Parser.pp$1.parseBlock (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:981:25)
    at Parser.pp$1.parseStatement (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:709:33)
    at Parser.pp$1.parseTopLevel (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:638:25)
    at Parser.parse (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:516:17)
    at Object.parse (<somePath>/frontendClient/resources/node_modules/acorn/dist/acorn.js:3098:39)
    at Parser.parse (<somePath>/frontendClient/resources/node_modules/webpack/lib/Parser.js:902:15)
    at DependenciesBlock.<anonymous> (<somePath>/frontendClient/resources/node_modules/webpack/lib/NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (<somePath>/frontendClient/resources/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
    at nextLoader (<somePath>/frontendClient/resources/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
    at <somePath>/frontendClient/resources/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
    at Storage.provide (<somePath>/frontendClient/resources/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:52:20)
    at CachedInputFileSystem.readFile (<somePath>/frontendClient/resources/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:140:24)
    at DependenciesBlock.onLoadPitchDone (<somePath>/frontendClient/resources/node_modules/webpack-core/lib/NormalModuleMixin.js:255:7)
    at DependenciesBlock.loadPitch (<somePath>/frontendClient/resources/node_modules/webpack-core/lib/NormalModuleMixin.js:182:27)
    at DependenciesBlock.doBuild (<somePath>/frontendClient/resources/node_modules/webpack-core/lib/NormalModuleMixin.js:241:4)
    at DependenciesBlock.build (<somePath>/frontendClient/resources/node_modules/webpack/lib/NormalModule.js:84:14)
    at Compilation.buildModule (<somePath>/frontendClient/resources/node_modules/webpack/lib/Compilation.js:126:9)
    at <somePath>/frontendClient/resources/node_modules/webpack/lib/Compilation.js:309:10
    at <somePath>/frontendClient/resources/node_modules/webpack/lib/NormalModuleFactory.js:58:13
    at NormalModuleFactory.applyPluginsAsyncWaterfall (<somePath>/frontendClient/resources/node_modules/tapable/lib/Tapable.js:75:69)
    at onDoneResolving (<somePath>/frontendClient/resources/node_modules/webpack/lib/NormalModuleFactory.js:38:11)
    at onDoneResolving (<somePath>/frontendClient/resources/node_modules/webpack/lib/NormalModuleFactory.js:121:6)
    at <somePath>/frontendClient/resources/node_modules/webpack/lib/NormalModuleFactory.js:116:7
    at <somePath>/frontendClient/resources/node_modules/webpack/node_modules/async/lib/async.js:726:13
    at <somePath>/frontendClient/resources/node_modules/webpack/node_modules/async/lib/async.js:52:16
 @ ./~/draft-convert/lib/index.js 20:15-41
@toblix
Copy link

toblix commented May 2, 2017

Apparently this is a webpack config thing. I found a solution here: webpack/webpack#965

@benbriggs
Copy link
Contributor

Oops sorry, didn't think about the implications of needing to add json-loader for webpack consumers. I'll patch out the dependency since it was just used for conveniently adding the version to the main export

@adamskihood
Copy link

Hey @benbriggs first of all thanks for awesome library.. Any chance of removing that dependency to fix webpack installation?

@Topperfalkon
Copy link

@benbriggs any update on this issue?

@benbriggs
Copy link
Contributor

fix for this is in v1.4.10

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

Successfully merging a pull request may close this issue.

5 participants