Open merianos opened 3 years ago
Exact same error observed in our production app, first using v. 6.0.25. We then downgraded to 6.0.19 to see if the error had something to do with the updated Webpack-dependency, but this did not help.
Did I see this right that your code try to load the assets from the 'src' directory instead of the 'dist' directory?
Btw. what happend when you write it like so:
const mix = require("laravel-mix")
mix.setPublicPath("dist")
mix.webpackConfig({
output: {
publicPath: "/assets/dist/",
chunkFilename: 'js/modules/[name].js'
}
})
mix.js("src/js/app.js", "js")
.version()
Description:
Hi,
I am quite new to webpack modules (I am not sure if I call them modules correctly but I will explain later what I mean) and I am faced with a very weird issue.
Let me first explain what I have so far.
Currently I have a
webpack.mix.js
file with the following contents:then in the path
assets/src/js
I have the following files:The two js files under the theme folder containing code like that:
and finally in my app.js file I have the following code:
Finally when I compile this the output generated is the following:
The above code on my local environment it works perfectly. But when I go on staging/production I get the following error:
At the same time, if I click the link
https://SITE-DOMAIN/web-assets/themes/THEME-NAME/assets/dist/js/modules/rr-card-link.js
the file content is loading properly.Is there any idea why I have that issue or how I could solve it ?
Thank you all in advance.