Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling release without sourceMap create a sourcemap named "false" #2751

Closed
DaGaMx opened this issue Sep 28, 2023 · 2 comments · Fixed by #2802
Closed

Compiling release without sourceMap create a sourcemap named "false" #2751

DaGaMx opened this issue Sep 28, 2023 · 2 comments · Fixed by #2802
Labels

Comments

@DaGaMx
Copy link

DaGaMx commented Sep 28, 2023

Bug description

I am new to AssemblyScript and followed your tutorial:
https://www.assemblyscript.org/getting-started.html#setting-up-a-new-project

I checked the output files in a hex editor and was wondering that the release ends with "sourceMappingURL" "false".
Then I saw that a file named "false" is generated in the output folder.

Steps to reproduce

Execute this:
npx asc "C:\test\assembly\index.ts" --target release -o "C:\test\assembly\output\release\index.wasm" -Ospeed --noAssert --optimizeLevel 3

In the output folder "C:\test\assembly\output\release" will be a file named "false".
The output file "C:\test\assembly\output\release\index.wasm" will contain a reference to that source map.

As far as I understand the compiler manual, the source map should only be generated if I specify --sourceMap.

AssemblyScript version

v0.27.10

@DaGaMx DaGaMx added the bug label Sep 28, 2023
@woruyu
Copy link

woruyu commented Oct 23, 2023

Ask a question:
I follows your step to run npx asc "C:\test-as\assembly\index.ts" --target release -o "C:\test-as\assembly\output\release\index.wasm" -Ospeed --noAssert --optimizeLevel 3 but I can't get a file named "false". I just get a file named index.wasm.map. And I guess the reason that you get the source map is in asconfig.json, the sourceMap field is true.
image

@DaGaMx
Copy link
Author

DaGaMx commented Nov 3, 2023

Sorry, there was a minor thing I changed in comparison to your "Getting started" manual.
If I do the same steps like in the manual, then I get the "./index.wasm.map" entry like you.
But if I update the asconfig.json to this:
{ "targets": { "debug": { "outFile": "build/debug.wasm", "textFile": "build/debug.wat", "sourceMap": true, "debug": true }, "release": { "outFile": "build/release.wasm", "textFile": "build/release.wat", "sourceMap": false, "optimizeLevel": 3, "shrinkLevel": 0, "converge": false, "noAssert": false } }, "options": { "bindings": "esm" } }
Then I get the false entry and the false file. (I only changed "sourceMap" to false in the release configuration).

This also happens if I compile using "npm run asbuild".

@HerrCai0907 HerrCai0907 linked a pull request Nov 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants