-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Missing jsdom dependencies for dist/node/* stuffs? #1347
Comments
|
But shouldn't there be some way for Paper.js to use its own |
I guess this is a short-coming of using the shim-package approach described here: The problem I believe is that the dependency is of the This would be easy to fix if paper.js only existed for node.js. But we're dealing with rather complex hybrid scenarios, and I haven't found an approach that makes everybody happy yet... Perhaps there's a way to have |
But the easier fix is probably simply to get paper.js working with jsdom 11 |
There is an issue unfortunately that is blocking jsdom v10 & v11 for us: |
I have a very similar error. I am bundling TypeError: Cannot read property 'parent' of undefined
at Object.eval (webpack:///./node_modules/paper/dist/node/self.js?:20:28)
at eval (webpack:///./node_modules/paper/dist/node/self.js?:62:30)
at Object../node_modules/paper/dist/node/self.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:34531:1)
at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30)
at Object.eval (webpack:///./node_modules/paper/dist/paper-core.js?:35:16)
at eval (webpack:///./node_modules/paper/dist/paper-core.js?:14798:3)
at Object../node_modules/paper/dist/paper-core.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:34553:1)
at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30)
at eval (webpack:///./node_modules/react-paper-bindings/lib/View.js?:15:18)
at Object../node_modules/react-paper-bindings/lib/View.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:37188:1) If I manually fix the var parent = module.parent ? module.parent.parent : null, but then I get a second error, same as @pm5: TypeError: jsdom.jsdom is not a function
at Object.<anonymous> (/home/bojan/www/climbuddy/client/server/map.bundle.js:264508:26)
at Object../node_modules/paper/dist/node/self.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:264530:30)
at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30)
at Object.<anonymous> (/home/bojan/www/climbuddy/client/server/map.bundle.js:264626:16)
at Object../node_modules/paper/dist/paper-core.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:279389:3)
at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30)
at Object../node_modules/react-paper-bindings/lib/View.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:311955:18)
at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30)
at Object../node_modules/react-paper-bindings/lib/index.js (/home/bojan/www/climbuddy/client/server/map.bundle.js:312128:13)
at __webpack_require__ (/home/bojan/www/climbuddy/client/server/map.bundle.js:26:30) because one of my other dependencies (maybe After looking at the source code, I managed to find a hacky solution for my use case. In my // paper.js ssr fix
global.self = {
navigator: {
userAgent: `Node.js (${process.platform}; U; rv:${process.version})`
}
} |
I get the following error if I include paper-jsdom 0.11.4 in a project that is already using jsdom 11.0.0:
I think the reason for that is Paper.js, specifically things under
dist/node
, are using jsdom ^9.4.0, but jsdom is a devDependency so it is not installed, and the top-level jsdom (which is 11.0.0 in my case) will be used.You can reproduce the error with:
I'm not familiar with Paper.js build pipeline so I'm not sure if the better course of action is to bundle jsdom for
dist/node
or to just move jsdom to dependency (which I think Paper.js is trying to avoid having any).The text was updated successfully, but these errors were encountered: