NativeScript / NativeScript/nativescript-cli

Crashing after multiple changes

Open
#5,403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 7.0.0
  • Cross-platform modules: -
  • Android Runtime: -
  • iOS Runtime: -
  • Plugin(s): -

Describe the bug
I am running my apps with --no-hmr
after multiple file changes i end up with a crash:

RuntimeError: memory access out of bounds
    at wasm-function[18]:0xf76
    at wasm-function[28]:0x3494
    at BasicSourceMapConsumer._parseMappings (/usr/local/pnpm-global/4/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/source-map-consumer.js:335:44)
    at BasicSourceMapConsumer._getMappingsPtr (/usr/local/pnpm-global/4/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/source-map-consumer.js:315:12)
    at /usr/local/pnpm-global/4/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/source-map-consumer.js:510:14
    at Object.withMappingCallback (/usr/local/pnpm-global/4/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/wasm.js:95:11)
    at BasicSourceMapConsumer.originalPositionFor (/usr/local/pnpm-global/4/node_modules/.pnpm/source-map@0.7.3/node_modules/source-map/lib/source-map-consumer.js:508:16)
    at LogSourceMapService.getOriginalFileLocation (/usr/local/pnpm-global/4/node_modules/.pnpm/nativescript@7.0.8/node_modules/nativescript/lib/services/log-source-map-service.js:116:46)
    at /usr/local/pnpm-global/4/node_modules/.pnpm/nativescript@7.0.8/node_modules/nativescript/lib/services/log-source-map-service.js:72:43
    at Array.forEach (<anonymous>)

This happens with or without source maps

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with log-source-map-service.js, especially getOriginalFileLocation, and inspect the source-map@0.7.3 stack shown in the report. Reproduce after multiple file changes with --no-hmr, both with and without source maps. Done means the CLI no longer crashes with the reported WebAssembly memory-access error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.