previewjs icon indicating copy to clipboard operation
previewjs copied to clipboard

can't resolve import path with jsconfig.json path

Open moharifhidayat7 opened this issue 5 years ago • 1 comments

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

  1. setup path with jsconfig.json file { "compilerOptions": { "baseUrl": "./", "paths": { "@components/*": ["components/*"], "@styles/*": ["styles/*"] } } }
  2. import inside component import Navbar from '@components/Navbar'
  3. open in ReactPreview

moharifhidayat7 avatar Sep 07 '21 05:09 moharifhidayat7

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 :)

fwouts avatar Sep 08 '21 08:09 fwouts