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

Browserify (and Webpack Builds Not Working) #156

Closed
xjamundx opened this issue Jun 25, 2015 · 6 comments
Closed

Browserify (and Webpack Builds Not Working) #156

xjamundx opened this issue Jun 25, 2015 · 6 comments

Comments

@xjamundx
Copy link
Contributor

There is an npm script for this project that I assume creates a browserify build, but it doesn't seem to work at all:

~/dev/espree (master) $ npm run browserify

> espree@2.0.3 browserify /Users/jamuferguson/dev/espree
> node Makefile.js browserify

Error: Cannot find module './package.json' from '/Users/jamuferguson/dev/espree/tmp'
    at /Users/jamuferguson/dev/espree/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:43:25
    at load (/Users/jamuferguson/dev/espree/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:99:43)
    at /Users/jamuferguson/dev/espree/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:105:22
    at /Users/jamuferguson/dev/espree/node_modules/browserify/node_modules/browser-resolve/node_modules/resolve/lib/async.js:22:47
    at FSReqWrap.oncomplete (fs.js:95:15)

Similarly webpack fails also complaining about package.json:

~/dev/espree (master) $ webpack espree.js espree.built.js
Error
    at Error.ModuleParseError (/usr/local/lib/node_modules/webpack/lib/ModuleParseError.js:23:15)
    at DependenciesBlock.<anonymous> (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:94:20)
    at DependenciesBlock.onModuleBuild (/usr/local/lib/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:283:10)
    at nextLoader (/usr/local/lib/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:253:25)
    at Storage.provide (/usr/local/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:52:20)
    at CachedInputFileSystem.readFile (/usr/local/lib/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:134:24)
    at DependenciesBlock.onLoadPitchDone (/usr/local/lib/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:238:7)
    at DependenciesBlock.loadPitch (/usr/local/lib/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:180:27)
    at DependenciesBlock.doBuild (/usr/local/lib/node_modules/webpack/node_modules/webpack-core/lib/NormalModuleMixin.js:224:4)
    at DependenciesBlock.build (/usr/local/lib/node_modules/webpack/lib/NormalModule.js:65:14)
Hash: fed409b2b1aa3ac5511a
Version: webpack 1.3.3-beta2
Time: 244ms
          Asset    Size  Chunks             Chunk Names
espree.built.js  241910       0  [emitted]  main
   [0] ./espree.js 152615 {0} [built] [1 error]
   [1] ./package.json -1 [built] [failed]
   [2] ./lib/syntax.js 16073 {0} [built]
   [3] ./lib/token-info.js 3571 {0} [built]
   [4] ./lib/ast-node-types.js 4942 {0} [built]
   [5] ./lib/ast-node-factory.js 30439 {0} [built]
   [6] ./lib/features.js 3604 {0} [built]
   [7] ./lib/messages.js 5838 {0} [built]
   [8] ./lib/xhtml-entities.js 7044 {0} [built]
   [9] ./lib/string-map.js 2066 {0} [built]
  [10] ./lib/comment-attachment.js 7083 {0} [built]

ERROR in ./package.json
Module parse failed: /Users/jamuferguson/dev/espree/package.json Line 2: Unexpected token :
You may need an appropriate loader to handle this file type.
| {
|   "name": "espree",
|   "description": "An actively-maintained fork of Esprima, the ECMAScript parsing infrastructure for multipurpose analysis",
|   "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
 @ ./espree.js 5450:18-43

@xjamundx
Copy link
Contributor Author

Looking into this as part of eslint/archive-website#77

@xjamundx
Copy link
Contributor Author

Solution for webpack problems is just webpack --module-bind json

@nzakas
Copy link
Member

nzakas commented Jun 25, 2015

Strange, no idea what that error is.

@xjamundx
Copy link
Contributor Author

Yeah super weird. I'm on node 0.12 if that matters.

@nzakas
Copy link
Member

nzakas commented Jun 25, 2015

Could just mean I copy-pasted this command from ESLint and never tested it. :)

@xjamundx
Copy link
Contributor Author

haha. I'll investigate when I get a chance!

ilyavolodin added a commit that referenced this issue Jul 11, 2015
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

2 participants