Skip to content

Webpack cannot find module "fs" #89

Description

@DylanGom

When i try to run test on my hybrid application with ionic.
My test fails cause of jsonpath.

This is on chrome

Chrome 63.0.3239 (Mac OS X 10.12.6) ERROR
  Uncaught Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
Chrome 63.0.3239 (Mac OS X 10.12.6) ERROR
  Uncaught Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
Chrome 63.0.3239 (Mac OS X 10.12.6) ERROR
  Uncaught Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
Chrome 63.0.3239 (Mac OS X 10.12.6) ERROR
  Uncaught Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
Chrome 63.0.3239 (Mac OS X 10.12.6): Executed 0 of 0 ERROR (1.513 secs / 0 secs)

This is with Phantom

PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
PhantomJS 2.1.1 (Mac OS X 0.0.0) ERROR
  Error: Cannot find module "fs"
  at webpack:///node_modules/jsonpath/lib/grammar.js:2:0 <- karma-test-shim.js:169477
PhantomJS 2.1.1 (Mac OS X 0.0.0): Executed 0 of 0 ERROR (0.882 secs / 0 secs)

A bit higher it gives this error as well

ERROR in ./node_modules/jsonpath/generated/parser.js
Module not found: Error: Can't resolve 'fs' in '/Users/dylangomes/Repos/checklist-ionic/node_modules/jsonpath/generated'
 @ ./node_modules/jsonpath/generated/parser.js 715:17-30
 @ ./node_modules/jsonpath/lib/parser.js
 @ ./node_modules/jsonpath/lib/index.js
 @ ./node_modules/jsonpath/index.js
 @ ./src/shared/checklist-renderer/checklist-renderer.ts
 @ ./src/shared/shared.module.ts
 @ ./src/pages/image-popover/image-popover.module.ts
 @ ./src/app/app.module.ts
 @ ./src/services/databaseService/database.service.spec.ts
 @ ./src \.spec\.ts
 @ ./test-config/karma-test-shim.js

ERROR in ./node_modules/jsonpath/lib/grammar.js
Module not found: Error: Can't resolve 'fs' in '/Users/dylangomes/Repos/checklist-ionic/node_modules/jsonpath/lib'
 @ ./node_modules/jsonpath/lib/grammar.js 2:9-22
 @ ./node_modules/jsonpath/lib/parser.js
 @ ./node_modules/jsonpath/lib/index.js
 @ ./node_modules/jsonpath/index.js
 @ ./src/shared/checklist-renderer/checklist-renderer.ts
 @ ./src/shared/shared.module.ts
 @ ./src/pages/image-popover/image-popover.module.ts
 @ ./src/app/app.module.ts
 @ ./src/services/databaseService/database.service.spec.ts
 @ ./src \.spec\.ts
 @ ./test-config/karma-test-shim.js
webpack: Failed to compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions