Codesandbox-client: tsconfig paths not supported?

Created on 8 May 2018  ·  8Comments  ·  Source: codesandbox/codesandbox-client

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.

stale ❕ Help Wanted 🤔 Improvement

All 8 comments

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.

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!

+1
That would be very helpful to fix.

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

Anything new on this?

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.

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

Anything new on this? ;)

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 😂

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eckmLJE picture eckmLJE  ·  3Comments

oliversturm picture oliversturm  ·  3Comments

wojciechczerniak picture wojciechczerniak  ·  3Comments

CompuIves picture CompuIves  ·  3Comments

alansouzati picture alansouzati  ·  3Comments