Build Error: unknown file: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "SequenceExpression" #1033
-
I'm trying to build my Snap and I get this error when trying to import the package I want to use. What are the possible causes of this error? Is it possible to work around it? I should note that The full error: Build error: Failed to post process code:
unknown file: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "SequenceExpression"
<ref *1> Error: Failed to post process code:
unknown file: Property left of AssignmentExpression expected node to be of a type ["LVal"] but instead got "SequenceExpression"
at postProcessBundle (/Users/kris/WebstormProjects/metamask/Snappy-wraps/node_modules/@metamask/snap-utils/dist/post-process.js:300:15)
at SnapsBrowserifyTransform._flush (/Users/kris/WebstormProjects/metamask/Snappy-wraps/node_modules/@metamask/snaps-browserify-plugin/dist/plugin.js:98:59)
at SnapsBrowserifyTransform.final [as _final] (node:internal/streams/transform:112:25)
at callFinal (node:internal/streams/writable:694:27)
at prefinish (node:internal/streams/writable:723:7)
at finishMaybe (node:internal/streams/writable:733:5)
at SnapsBrowserifyTransform.Writable.end (node:internal/streams/writable:631:5)
at Labeled.onend (/Users/kris/WebstormProjects/metamask/Snappy-wraps/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (node:events:645:28)
at Labeled.emit (node:events:538:35) {
stream: SnapsBrowserifyTransform {
_readableState: ReadableState {
objectMode: false,
highWaterMark: 16384,
buffer: BufferList { head: null, tail: null, length: 0 },
length: 0,
pipes: [],
flowing: false,
ended: false,
endEmitted: false,
reading: true,
constructed: true,
sync: false,
needReadable: true,
emittedReadable: false,
readableListening: true,
resumeScheduled: false,
errorEmitted: true,
emitClose: true,
autoDestroy: true,
destroyed: true,
errored: [Circular *1],
closed: true,
closeEmitted: false,
defaultEncoding: 'utf8',
awaitDrainWriters: null,
multiAwaitDrain: false,
readingMore: false,
dataEmitted: false,
decoder: null,
encoding: null,
[Symbol(kPaused)]: null
},
_events: [Object: null prototype] {
prefinish: [Function: prefinish],
error: [Function (anonymous)],
end: [Function],
readable: [Function]
},
_eventsCount: 4,
_maxListeners: undefined,
_writableState: WritableState {
objectMode: false,
highWaterMark: 16384,
finalCalled: true,
needDrain: false,
ending: true,
ended: true,
finished: false,
destroyed: true,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: false,
bufferProcessing: false,
onwrite: [Function: bound onwrite],
writecb: null,
writelen: 0,
afterWriteTickInfo: null,
buffered: [],
bufferedIndex: 0,
allBuffers: true,
allNoop: true,
pendingcb: 0,
constructed: true,
prefinished: false,
errorEmitted: true,
emitClose: true,
autoDestroy: true,
errored: [Circular *1],
closed: true,
closeEmitted: false,
[Symbol(kOnFinished)]: []
},
allowHalfOpen: true,
[Symbol(kCapture)]: false,
[Symbol(kCallback)]: null
}
}
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Our parser is having difficulty parsing your code to post process it to be compatible with Snaps platform. There seems to be something unusual about your code. Could you please share a minimum example or link to your project's source code? |
Beta Was this translation helpful? Give feedback.
-
@krisbitney Thanks for reporting this. This was a bug in our post-processing causing you to have problems building your snap. This will be fixed in the next release of the Snaps CLI. For the curious: #1040 |
Beta Was this translation helpful? Give feedback.
@krisbitney Thanks for reporting this. This was a bug in our post-processing causing you to have problems building your snap. This will be fixed in the next release of the Snaps CLI.
For the curious: #1040