Open amir-arad opened 3 years ago
getting the same
Applying this patch resolved my issue :)
I'm using yarn@3
.
tsconfig-paths-webpack-plugin-npm-3.5.2-7d7e8a5739.patch
diff --git a/lib/plugin.js b/lib/plugin.js
index fb5c8135527f8abf9671ccc8ab6a2e16efe5d5a8..c350b4993b0db61212bf2427ca45e52860898ca7 100644
--- a/lib/plugin.js
+++ b/lib/plugin.js
@@ -14,7 +14,7 @@ class TsconfigPathsPlugin {
const options = Options.getOptions(rawOptions);
this.extensions = options.extensions;
// const colors = new chalk.constructor({ enabled: options.colors });
- this.log = Logger.makeLogger(options, new chalk.Instance({ level: options.colors ? undefined : 0 }));
+ this.log = Logger.makeLogger(options, chalk);
const context = options.context || process.cwd();
const loadFrom = options.configFile || context;
const loadResult = TsconfigPaths.loadConfig(loadFrom);
Place the patch file in your .yarn/patches/tsconfig-paths-webpack-plugin-npm-3.5.2-7d7e8a5739.patch
folder (create the folder if it doesn't exist).
Then adding the resolution to you package.json
package.json
...,
"resolutions": {
"tsconfig-paths-webpack-plugin@3.5.2": "patch:tsconfig-paths-webpack-plugin@npm:3.5.2#.yarn/patches/tsconfig-paths-webpack-plugin-npm-3.5.2-7d7e8a5739.patch"
}
}
Then run yarn
Hope it helps somebody 🙂
This usually happens if you set tsconfig paths
pointing to node_modules
, like:
"paths": {
"*": ["node_modules/*"]
},
While module specifiers that match
paths
aliases are bare specifiers, once the alias is resolved, module resolution proceeds on the resolved path as a relative path. Consequently, resolution features that happen fornode_modules
package lookups, including package.json"exports"
field support, do not take effect when apaths
alias is matched. This can lead to surprising behavior ifpaths
is used to point to anode_modules
package: https://www.typescriptlang.org/docs/handbook/modules/reference.html#paths-should-not-point-to-monorepo-packages-or-node_modules-packages
I'm trying to use this plugin (
@3.3.0
) in next.js (@10
) and I get the following error:This is my next.config.js: