-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
toPath
imported from unicorn-magic
is not exported by the 0.1.0
dependency of that package in non-"node" context causing Webpack failures
#260
Comments
@DavidAnson you are not alone! ERROR:
|
Bummer. In case it helps, here's my workaround (ignore the setImmediate changes): DavidAnson/markdownlint-cli2@a37b780 |
In the new version of globby 14.0.0, the following issue has been identified: In the file globby/ignore.js, there is an import statement: import {toPath} from 'unicorn-magic'; This import leads to a submodule where the file Due to the absence of the export for
We kindly request you to address this issue promptly. One potential solution is to move the toPath function into the |
for hot fix module i've created postinstall script until we wait fix from @sindresorhus import fs from 'node:fs';
const text = fs.readFileSync('./node_modules/unicorn-magic/default.js', 'utf8');
const newScript = `import {fileURLToPath} from 'node:url';
export function toPath(urlOrPath) {
\treturn urlOrPath instanceof URL ? fileURLToPath(urlOrPath) : urlOrPath;
}
${text}`;
if(text.indexOf("toPath(") === -1) {
console.log("Fixing unicorn-magic script...")
fs.writeFileSync('./node_modules/unicorn-magic/default.js', newScript, 'utf8');
}else{
console.log("Skip fix unicorn-magic script.");
} |
I also encountered this |
If, like me, you are using optimizeDeps: {
exclude: ["@nuxt/kit"],
} Further details are explained here: storyblok/storyblok-nuxt#662 |
I had a little time to look into this problem further.
What's the problem?
"exports": {
"types": "./index.d.ts",
"node": "./node.js",
"default": "./default.js"
},
The problem we are facing is that when You have two options. The dirty solution: replacing the
|
For anyone else here:
|
This change introduces failures compiling
globby
under Webpack with target=webworker using a resolve/fallback forfileURLToPath
in theurl
module.I'm sure that scenario sounds weird, but it used to work with a certain amount of gymnastics: https://github.com/DavidAnson/markdownlint-cli2/tree/main/webworker
This commit introduces the issue by hiding a call to
fileURLToPath
inside the Node-only exporttoPath
: 2c06ae5#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519Unfortunately, I may be the only person on the planet who cares? FYI, I guess. I'll try more gymnastics to get my scenario working again.
The text was updated successfully, but these errors were encountered: