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

[Playground] two slash @filename not work in typescript playground #52666

Closed
magic-akari opened this issue Feb 8, 2023 · 6 comments
Closed
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug

Comments

@magic-akari
Copy link
Contributor

Bug Report

🔎 Search Terms

  • playground
  • two slash
  • filename

🕗 Version & Regression Information

  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
  • I was unable to test this on prior versions because _______

⏯ Playground Link

Playground link with relevant code

💻 Code

Code from https://github.com/microsoft/TypeScript-Website/tree/v2/packages/ts-twoslasher#import_filests

// @filename: file-with-export.ts
export const helloWorld = "Example string"

// @filename: index.ts
import { helloWorld } from "./file-with-export"
console.log(helloWorld)

🙁 Actual behavior

TS2307: Cannot find module './file-with-export' or its corresponding type declarations.

🙂 Expected behavior

It works.

@andrewbranch andrewbranch added the Working as Intended The behavior described is the intended behavior; this is not a bug label Feb 10, 2023
@andrewbranch
Copy link
Member

Multiple files aren’t supported on the playground.

@andrewbranch andrewbranch closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2023
@uloco
Copy link

uloco commented Feb 24, 2023

@andrewbranch You should consider updating the help docs on ts-playground then, it has an extra entry regarding multi-file playgrounds: https://www.typescriptlang.org/play#handbook-15

@DerGernTod
Copy link

please consider reopening this. this used to work, otherwise it wouldn't be documented. it also behaves very weird if you use it by showing a default "/input.tsx":
image

@RyanCavanaugh
Copy link
Member

this used to work

We don't intend to support this in the playground. You can use the Bug Workbench to do multi-file repros.

@jsejcksn
Copy link

jsejcksn commented Mar 30, 2023

We don't intend to support this in the playground. You can use the Bug Workbench to do multi-file repros.

@RyanCavanaugh Thanks for mentioning that. I wasn't aware of the Bug Workbench before today.

I'm actually still not sure how I can find it without a generalized search engine: there are no search results for "workbench" in the docs:

Screenshot 2023-03-30 at 15 09 41

Update: Here's a link to the workbench documentation page that I found by clicking around more in the playground — it's accessible via the "Help" menu at the top of the playground: https://www.typescriptlang.org/play?#handbook-17

@nyngwang
Copy link

@jsejcksn I searched for multi-file TS Playground and found your answer. I also didn't know about Bug Workbench before. Thanks for your sharing, it's very helpful for my debugging with the latest option verbatimModuleSyntax.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Working as Intended The behavior described is the intended behavior; this is not a bug
7 participants