Running into error: No template for dependency: ConstDependency #44
-
Bug descriptionwebpack throws the error above after building Expected behaviorNo error Reproduction steps
Environment |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 3 replies
-
Do you encounter this problem if you directly install from npm? |
Beta Was this translation helpful? Give feedback.
-
@privatenumber no the error above with npm install |
Beta Was this translation helpful? Give feedback.
-
This is not a bug then. Sounds like a problem in how you're setting up your dev environment (eg. with npm link). Moving this to Discussions. |
Beta Was this translation helpful? Give feedback.
-
You're probably getting this error because when you This is a debugging flaw in npm (link, specifically). Instead, try |
Beta Was this translation helpful? Give feedback.
-
@privatenumber BTW, how to use |
Beta Was this translation helpful? Give feedback.
-
I'm getting the same issue when I run my app with plugins: [
...
new LocalizeAssetsPlugin({
locales: {
es: path.resolve(__dirname, './locales/es.json'),
},
functionName: 'fnTranslation',
}),
] and in the component is using like this <span>{fnTranslation('header.title')}</span> when I run the app in development mode or run the build command the error it's the same, not sure If I'm missing something |
Beta Was this translation helpful? Give feedback.
You're probably getting this error because when you
npm link
, requests from withinwebpack-localize-assets-plugin
resolve its dependencies within its ownnode_modules
,which includes dev dependencies and a different version of Webpack from your application.This is a debugging flaw in npm (link, specifically). Instead, try
npm install <directory>
to do a clean install of the local package without dev dependencies.