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

app cannot find dependencies when invoking Birdwatch() #19

Closed
derHowie opened this issue Apr 23, 2016 · 5 comments
Closed

app cannot find dependencies when invoking Birdwatch() #19

derHowie opened this issue Apr 23, 2016 · 5 comments

Comments

@derHowie
Copy link
Contributor

derHowie commented Apr 23, 2016

Here is a small snippet of the error report. When I remove the call to birdwatch my app functions as usual.

ERROR in ./~/get-port/index.js
Module not found: Error: Cannot resolve module 'net' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/get-port
 @ ./~/get-port/index.js 2:10-24

ERROR in ./~/birdwatch/package.json
Module parse failed: /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/birdwatch/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.raise (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:920:13)
    at Parser.pp.unexpected (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1483:8)
    at Parser.pp.semicolon (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1462:73)
    at Parser.pp.parseExpressionStatement (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1976:8)
    at Parser.pp.parseStatement (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1754:188)
    at Parser.pp.parseBlock (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1991:21)
    at Parser.pp.parseStatement (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1735:19)
    at Parser.pp.parseTopLevel (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1648:21)
    at Parser.parse (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:1616:17)
    at Object.parse (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/node_modules/acorn/dist/acorn.js:882:44)
    at Parser.parse (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/lib/Parser.js:902:15)
    at DependenciesBlock. (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack/lib/NormalModule.js:104:16)
    at DependenciesBlock.onModuleBuild (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack-core/lib/NormalModuleMixin.js:310:10)
    at nextLoader (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack-core/lib/NormalModuleMixin.js:275:25)
    at /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/webpack-core/lib/NormalModuleMixin.js:259:5
    at Storage.provide (/Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:52:20)
 @ ./~/birdwatch/dist/report.js 4:14-37

ERROR in ./~/birdwatch/dist/utils.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/birdwatch/dist
 @ ./~/birdwatch/dist/utils.js 20:10-23

ERROR in ./~/mkdirp/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/mkdirp
 @ ./~/mkdirp/index.js 2:9-22

ERROR in ./~/express/lib/request.js
Module not found: Error: Cannot resolve module 'net' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/express/lib
 @ ./~/express/lib/request.js 18:11-25

ERROR in ./~/express/lib/view.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/express/lib
 @ ./~/express/lib/view.js 18:9-22

ERROR in ./~/send/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/send
 @ ./~/send/index.js 25:9-22

ERROR in ./~/etag/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/etag
 @ ./~/etag/index.js 22:12-25

ERROR in ./~/destroy/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/destroy
 @ ./~/destroy/index.js 14:17-30

ERROR in ./~/mime/mime.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/mime
 @ ./~/mime/mime.js 2:9-22
@radiovisual
Copy link
Owner

radiovisual commented Apr 23, 2016

Hm. I am not able to reproduce this problem. I followed the install steps on the readme, and ran the test sample in the readme and it all works perfectly for me.

From what I can read on your error report, the problem (for whatever reason) seems to be coming from the node_modules/birdwatch/package.json file:

Module parse failed: /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/birdwatch/package.json Unexpected token (2:9)

and if an error is found in the package.json, then the app would have a hard time finding all the dependencies properly, hence all the other errors in the report you provided. So I am thinking that somehow your install of birdwatch was corrupted.

I would try these steps to resolve the problem (basically, just re-installing birdwatch):

  1. Copy [or Move] your node_modules/birdwatch/local-config.js file somewhere outside of the node_modules/birdwatch directory.
  2. Delete the node_modules/birdwatch directory
  3. Reinstall Birdwatch: npm install birdwatch
  4. Move the copied file from Step 1 back into the node_modules/birdwatch directory

Now try running your app again.

If you complete these steps, and you still get the same errors, please provide me with:

  1. A copy of the node_modules/birdwatch/package.json file, and
  2. The code you are using that calls Birdwatch.

Thanks.

@radiovisual
Copy link
Owner

Are you still having this problem?

@derHowie
Copy link
Contributor Author

I did some clean up and isolated the problem down to these specific errors:

ERROR in ./~/birdwatch/dist/utils.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/birdwatch/dist
 @ ./~/birdwatch/dist/utils.js 20:10-23
ERROR in ./~/get-port/index.js
Module not found: Error: Cannot resolve module 'net' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/get-port
 @ ./~/get-port/index.js 2:10-24
ERROR in ./~/mkdirp/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/mkdirp
 @ ./~/mkdirp/index.js 2:9-22
ERROR in ./~/express/lib/request.js
Module not found: Error: Cannot resolve module 'net' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/express/lib
 @ ./~/express/lib/request.js 18:11-25
ERROR in ./~/express/lib/view.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/express/lib
 @ ./~/express/lib/view.js 18:9-22
ERROR in ./~/send/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/send
 @ ./~/send/index.js 25:9-22
ERROR in ./~/etag/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/etag
 @ ./~/etag/index.js 22:12-25
ERROR in ./~/destroy/index.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/destroy
 @ ./~/destroy/index.js 14:17-30
ERROR in ./~/mime/mime.js
Module not found: Error: Cannot resolve module 'fs' in /Users/ChristopherHoward/Documents/github-projects/birdfeed/node_modules/mime
 @ ./~/mime/mime.js 2:9-22

@radiovisual
Copy link
Owner

these errors actually don't look specific to Birdwatch. They appear as if your module is not able to find node's built-ins (in this case, either the fs or net) modules. This is not Birdwatch, this is a problem with your loading configuration or your environment. You will probably find some help by reading the solutions detailed here.

@radiovisual
Copy link
Owner

👍

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

2 participants