TypeStrong / TypeStrong/ts-loader

Syntax error, no try catch block in JSON parsing

Open
#1,493 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.5k
Forks
439
Avg merge
17h 17m
Merged PRs (30d)
2

Description

https://github.com/TypeStrong/ts-loader/blob/b4b036325b4cd97fab8b3f01fc7bc849373839d4/src/watch-run.ts#L106

I get a SyntaxError: Unexpected token _ in JSON at position 0 using webpack and ts-loader when using hot reload with webpack.

As a result although building works, Hot Reload recompilation only does not work.
Also if I set transpileOnly: true, recompile works.

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 at src/watch-run.ts line 106 and reproduce the reported webpack hot-reload failure with ts-loader. Investigate the JSON parsing path and verify that hot-reload recompilation works for the reported case without affecting normal builds; run any relevant existing checks before confirming the fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, webpack
Domain
build-system, tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.