This repository has been archived by the owner on Sep 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 270
"chunkFilename.replace is not a function" on webpack 5 #305
Comments
You don't need this loader with webpack@5 |
@alexander-akait can u plz elaborate ? |
https://github.com/webpack/webpack/tree/master/examples/worker, example how use web workers without worker-loader for webpack@5 |
using the example, the error are gone but so does the functionality aswell, the above code no longer works. here how the above look now
const musicMetadata = require('music-metadata-browser')
onconnect = function (e) {
for (const port of e.ports) {
port.onmessage = (e) => {
let url = e.data
musicMetadata
.fetchFromUrl(url)
.then((val) => {
let res = val.common
let picture = res.picture
port.postMessage({
artist : res.artist,
title : res.title,
cover : picture
? URL.createObjectURL(new Blob([picture[0].data.buffer]))
: null
})
})
}
}
}
const AudioWorker = new SharedWorker(
new URL('../webworkers/audio.js', import.meta.url),
{
name: 'audio'
}
)
AudioWorker.port.onmessage = ({data}) => {
this.audioFileMeta = data
}
AudioWorker.port.postMessage(url) |
finally got it working, we should use thanks alot for the example & the headsup, merry Christmas btw 🎊 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Expected Behavior
should work same as it did with wp v4
Actual Behavior
on v5 we are getting this error
Code
using laravel-mix
The text was updated successfully, but these errors were encountered: