Fix startLineNumber from potentially breaking.#113
Open
whitneyit wants to merge 1 commit intogfranko:masterfrom
whitneyit:fix/start-line
Open
Fix startLineNumber from potentially breaking.#113whitneyit wants to merge 1 commit intogfranko:masterfrom whitneyit:fix/start-line
startLineNumber from potentially breaking.#113whitneyit wants to merge 1 commit intogfranko:masterfrom
whitneyit:fix/start-line
Conversation
When trying to clean my code I run into the following error: > TypeError: Cannot read property 'start' of undefined > at Object.convertDefinesAndRequires ($PWD/node_modules/amdclean/src/amdclean.js:981:64) > at Controller.estraverse.replace.enter ($PWD/node_modules/amdclean/src/amdclean.js:1218:40) > at Controller.__execute ($PWD/node_modules/estraverse/estraverse.js:399:31) > at Controller.replace ($PWD/node_modules/estraverse/estraverse.js:633:27) > at Object.replace ($PWD/node_modules/estraverse/estraverse.js:714:27) > at Object.traverseAndUpdateAst ($PWD/node_modules/amdclean/src/amdclean.js:1197:14) > at Object.clean ($PWD/node_modules/amdclean/src/amdclean.js:1271:30) > at publicAPI.clean ($PWD/node_modules/amdclean/src/amdclean.js:1667:91) > at DestroyableTransform._transform ($PWD/index.js:39:26) > at DestroyableTransform.Transform._read ($PWD/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10) > at DestroyableTransform.Transform._write ($PWD/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83) > at doWrite ($PWD/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64) > at writeOrBuffer ($PWD/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5) > at DestroyableTransform.Writable.write ($PWD/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11) > at CompileStream.ondata (_stream_readable.js:528:20) > at emitOne (events.js:77:13) I found by hardening the check of `convertDefinesAndRequires` with the code in this PR prevents this error from being thrown.
|
I had the same error when using AMDClean on a Typescript bundle. Here is my single line version of the above:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When trying to clean my code I run into the following error:
I found by hardening the check of
convertDefinesAndRequireswith thecode in this PR prevents this error from being thrown.