You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During execution, result.map is, for some reason, not a JSON object, but a Buffer representing the JSON string. And because toJSON method is actually defined on a Buffer, this part of the code calls toJSON method on the Buffer object, resulting in the wrong format later on.
A quick fix I found would be replacing that part by the following:
Vue version
3.4.3
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-3fervz?file=package.json
Steps to reproduce
Open the minimal repo, and execute
npm run build
to see the error.What is expected?
The project should build and create a
dist
folder, containg a js file, a css file, and their sourcemaps.What is actually happening?
The following error appear:
System Info
No response
Any additional comments?
I've tracked this issue down to its source:
core/packages/compiler-sfc/src/style/preprocessors.ts
Lines 43 to 45 in 8498fcb
During execution,
result.map
is, for some reason, not a JSON object, but aBuffer
representing the JSON string. And becausetoJSON
method is actually defined on aBuffer
, this part of the code callstoJSON
method on theBuffer
object, resulting in the wrong format later on.A quick fix I found would be replacing that part by the following:
I've made a PR based on this observation, but I'm not totally sure if this is the right way to fix it.
The text was updated successfully, but these errors were encountered: