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

doesn't play nice with webpack #5

Open
bcowgill opened this issue May 11, 2016 · 1 comment
Open

doesn't play nice with webpack #5

bcowgill opened this issue May 11, 2016 · 1 comment

Comments

@bcowgill
Copy link
Contributor

I am trying to use your Abstract browser in a react app and it doesn't work well with webpack.
at some point it's also trying to pull in node modules for a browser build.

WARNING in .//mock-browser//jsdom/lib/jsdom/living/xmlhttprequest.js
Critical dependencies:
25:23-30 require function is used in a way in which dependencies cannot be statically extracted
@ .//mock-browser//jsdom/lib/jsdom/living/xmlhttprequest.js 25:23-30

WARNING in .//mock-browser//jsdom/lib/jsdom/living/window/History.idl
Module parse failed: /home/bcowgill/workspace/projects/docuzilla/webui/node_modules/mock-browser/node_modules/jsdom/lib/jsdom/living/window/History.idl Line 1:
Unexpected reserved word
You may need an appropriate loader to handle this file type.
| enum ScrollRestoration { "auto", "manual" };
|
| interface History {
@ .//mock-browser//jsdom/lib/jsdom/living ^./.*$

WARNING in .//mock-browser//acorn/dist/acorn.js
Critical dependencies:
1:478-485 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ .//mock-browser//acorn/dist/acorn.js 1:478-485

WARNING in .//acorn-globals//acorn/dist/walk.js
Critical dependencies:
1:503-510 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ .//acorn-globals//acorn/dist/walk.js 1:503-510

WARNING in .//acorn-globals//acorn/dist/acorn.js
Critical dependencies:
1:478-485 This seems to be a pre-built javascript file. Though this is possible, it's not recommended. Try to require the original source to get better results.
@ .//acorn-globals//acorn/dist/acorn.js 1:478-485

ERROR in .//mock-browser//jsdom/lib/jsdom.js
Module not found: Error: Cannot resolve module 'fs' in /home/bcowgill/workspace/projects/docuzilla/webui/node_modules/mock-browser/node_modules/jsdom/lib
resolve module fs in /home/bcowgill/workspace/projects/docuzilla/webui/node_modules/mock-browser/node_modules/jsdom/lib
looking for modules in /home/bcowgill/workspace/projects/docuzilla/webui/node_modules/mock-browser/node_modules
/home/bcowgill/workspace/projects/docuzilla/webui/node_modules/mock-browser/node_modules/fs doesn't exist (module as directory)
resolve 'file' fs in /home/bcowgill/workspace/projects/docuzilla/webui/node_modules/mock-browser/node_modules
resolve file
/home/bcowgill/workspace/projects/docuzilla/webui/node_modules/mock-browser/node_modules/fs doesn't exist

@bcowgill
Copy link
Contributor Author

Eureka, I changed this

import mockBrowser from 'mock-browser'
const displayName = 'Browser'
, AbstractBrowser = mockBrowser.delegates.AbstractBrowser

to this

import AbstractBrowser from 'mock-browser/lib/AbstractBrowser'

And webpack is happy. Makes sense actually.

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

1 participant