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

tsconfig paths not supported? #807

Closed
kamranayub opened this issue May 8, 2018 · 12 comments · Fixed by #6304 · 4 remaining pull requests
Closed

tsconfig paths not supported? #807

kamranayub opened this issue May 8, 2018 · 12 comments · Fixed by #6304 · 4 remaining pull requests
Assignees
Labels
🎒 Bundler Refers to CodeSandbox's In-Browser Bundler ❕ Help Wanted 🤔 Improvement

Comments

@kamranayub
Copy link

I am hoping to use CodeSandbox for an upcoming presentation to have an in-browser editor experience. I tried importing my (working) local TypeScript create-react-app repo: https://github.com/kamranayub/sample-react-ts-app (sandbox: https://codesandbox.io/s/n1kn3z5l9m)

When I import it into CodeSandbox, it doesn't like the tsconfig paths options. This is a useful feature for a lot of reasons (short imports, etc.). Any idea if that will be supported? It's supported in a vanilla CRA TS project.

@CompuIves
Copy link
Member

We don't support this yet, but is definitely aligned with one of our goals. So it'd be great to have this.

We already have alias support in the sandbox compiler, so the one thing we need to do is have a way to be able to convert a path using the paths object. Something like

getAliasedPath = (path: string) => {
  const { parsed } = this.configurations.tsconfig;
  // Now use parsed.paths to convert path
}

I expect that a similar function is already somewhere out there because it's used in the local tsc compiler.

@joseluisq
Copy link

joseluisq commented Jul 24, 2018

I also have the same problem with custom tsconfig paths.

DependencyNotFoundError
Could not find dependency: '@app/app' relative to '/src/main.tsx'
Suggested solutions:
Add @app/app as dependency
▶ 5 stack frames were collapsed.
evaluate
file:///src/main.tsx:3
  1 | import { app } from "hyperapp";
  2 | import { Actions, State } from "@app/types";
> 3 | import { actions, state, view } from "@app/app";
  4 | 
  5 | app<State, Actions>(state, actions, view, document.body);
  6 | 
View compiled
▶ 16 stack frames were collapsed.

I hope you can fix soon!

@merkuriy
Copy link

merkuriy commented Sep 8, 2019

+1
That would be very helpful to fix.

Example project github/Angular-RU/angular-ngrx-starter

@BeSpunky
Copy link

Anything new on this?

@github-actions
Copy link

This issue has automatically been marked stale because there has been no activity in a while. Please leave a comment if the issue has not been resolved, or if it is not stale for any other reason. After 2 weeks, this issue will automatically be closed, unless a comment is made or the stale label is removed.

@github-actions github-actions bot added the stale label Nov 14, 2020
@github-actions
Copy link

This issue has been automatically closed because there wasn't any activity after the previous notice or the stale label wasn't removed.

@pawel-tomkowski
Copy link

pawel-tomkowski commented Dec 4, 2020

Anything new on this? ;)

@deadcoder0904
Copy link

Yep I thought it did work so I asked again.

Would defo love this. Otherwise all the time goes in changing the imports which is boring work 😂

@MichaelDeBoey
Copy link
Contributor

I just had this issue myself too

@MichaelDeBoey MichaelDeBoey reopened this Jan 20, 2021
@github-actions
Copy link

This issue has automatically been marked stale because there has been no activity in a while. Please leave a comment if the issue has not been resolved, or if it is not stale for any other reason. After 2 weeks, this issue will automatically be closed, unless a comment is made or the stale label is removed.

@github-actions github-actions bot added the stale label Apr 21, 2021
@github-actions
Copy link

github-actions bot commented May 7, 2021

This issue has been automatically closed because there wasn't any activity after the previous notice or the stale label wasn't removed.

@github-actions github-actions bot closed this as completed May 7, 2021
@CompuIves CompuIves reopened this May 20, 2021
@lbogdan lbogdan added 🎒 Bundler Refers to CodeSandbox's In-Browser Bundler and removed stale labels May 24, 2021
@DeMoorJasper
Copy link
Member

This is gonna be fixed once we rewrite the resolver, which is planned to happen soonish

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment