solidjs / solidjs/solid-playground
Scripts without import/export appear to be duplicated
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 244
- Forks
- 69
- PR merge metrics
- No merged PRs in 30d
Description

As described by @modderme123 in https://github.com/solidjs/solid-playground/pull/103#issuecomment-1121503818:
This is an issue with files that don't have imports or exports and are then treated as a global script file. One trick might be to add a tsconfig flag to ignore output_dont_import.tsx?
I tried adding an exclude option to languages.typescript.typescriptDefaults.setCompilerOptions (in src/components/editor/setupSolid.ts) but it doesn't seem to fix the problem.
I previously wrote:
It seems that
src/components/editor/monacoTabs.tsx'sMonacoTabscreates two models: themodelat the top of the function and themodelfor each tab in tabs. I'm seeing the same source code in both the root model and a tab, which is presumably the source of the problem. [...] Could we remove one of the duplicates (presumably the top-level model?)?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the duplication from the linked Playground example, then inspect src/components/editor/monacoTabs.tsx and src/components/editor/setupSolid.ts. Start by tracing how the root model and per-tab models are created and how TypeScript treats files without imports or exports. Done means those scripts no longer appear duplicated without breaking tab compilation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100