previewjs
previewjs copied to clipboard
can't resolve import path with jsconfig.json path
Describe the bug
error when import component with jsconfig path
Failed to resolve import "@components/Navbar" from "components/Layout.jsx". Does the file exist?
Reproduction
- setup path with jsconfig.json file
{ "compilerOptions": { "baseUrl": "./", "paths": { "@components/*": ["components/*"], "@styles/*": ["styles/*"] } } } - import inside component
import Navbar from '@components/Navbar' - open in ReactPreview
Hi @moharifhidayat7, did you find a way around this? In case you haven't yet, you'll find some useful info in https://reactpreview.com/docs/config/aliases :)