I get “Automatic publicPath is not supported in th...
# kvision
a
I get “Automatic publicPath is not supported in this browser” when trying to load a script programmatically in kvision 5. I had never run into this before upgrading to kvision 5 (I was on a very old version), and figured out that this is a webpack 5 issue. Has anyone else run into this, and if so what did you do to fix it?
a
I did try this by adding
Copy code
config.output.publicPath = 'auto'
to webpack.js, but to no avail
r
Could you please describe what you mean by loading script programmatically?
Could you provide some code example?
a
Yep! You can see here: spotify-web-api-browser-example/index.html at master · adamint/spotify-web-api-browser-example (github.com) I did confirm that the bundle does exist
This isn’t an issue when directly referencing an asset, like in a script tag, but this isn’t possible in my application due to Spotify’s limitations, so I have to dynamically load the script, which used to work in kvision.
r
Adding this
config.output["publicPath"] = '';
to
webpack.config.d/webpack.js
seems to fix the loading problem for me
Not sure what side effects does it cause 😉
a
Thank you so much! I will try it out. I guess I’ll find out soon 😄
Aha, it works!
801 Views