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

Error: Cannot find module './src/utils\dirname.cjs' #60

Closed
kimmobrunfeldt opened this issue May 4, 2020 · 6 comments
Closed

Error: Cannot find module './src/utils\dirname.cjs' #60

kimmobrunfeldt opened this issue May 4, 2020 · 6 comments

Comments

@kimmobrunfeldt
Copy link
Contributor

Using svgdom@0.1.1. When I try to require() the module in node code or interactive session, I get an error. Using node 8.17.0.

> require('svgdom')
Error: Cannot find module './src/utils\dirname.cjs'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object../dirname.cjs (/home/kimmo/project/node_modules/svgdom/main-require.cjs:96:18)
    at __webpack_require__ (/home/kimmo/project/node_modules/svgdom/main-require.cjs:20:30)
    at Module../src/utils/defaults.js (/home/kimmo/project/node_modules/svgdom/main-require.cjs:3655:70)
    at __webpack_require__ (/home/kimmo/project/node_modules/svgdom/main-require.cjs:20:30)
    at Module../main-module.js (/home/kimmo/project/node_modules/svgdom/main-require.cjs:109:80)
    at __webpack_require__ (/home/kimmo/project/node_modules/svgdom/main-require.cjs:20:30)
@Fuzzyma
Copy link
Member

Fuzzyma commented May 4, 2020

wow, I only released today. You are fast. Found a bug I need to fix though, so there will be another release today.
For your issue: I am running the latest node (v13.12) and didnt have any problems. Also the interactive session required the module without any problems. So this is pretty hard for me to debug.

@mathias-mcb
Copy link

Hey, seeing the same error in my env.
node: v12.16.1
npm: 6.13.4

@Fuzzyma
Copy link
Member

Fuzzyma commented May 4, 2020

mh in that case I might need to rise the minimum node version. This might have something to do how node resolves esm vs cjs modules. They introduced a new way to declare esm modules in v13.

Oh - moment - I just see that there is a stray \ - could this be the reason? I work on a windows machine and both / and \ work

@Fuzzyma
Copy link
Member

Fuzzyma commented May 4, 2020

Alright, I published 0.1.4 which gets rid of the \. Hope that resolved it!

@mathias-mcb
Copy link

0.1.4 solves the issue for me. thanks for the quick fix 👍
(Indeed I had the issue on my mac and on the ubuntu build server)

@Fuzzyma Fuzzyma closed this as completed May 5, 2020
@kimmobrunfeldt
Copy link
Contributor Author

Thanks for the quick fix! Yea the timing was a funny coincidence :D

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

3 participants