FredKSchott / create-snowpack-app

The all-in-one app template for Snowpack. [moved]
https://www.snowpack.dev
Other
727 stars 96 forks source link

[@snowpack/app-template-react-typescript] got error about top-level import #145

Closed johnsmithsren closed 4 years ago

johnsmithsren commented 4 years ago

sorry to bother. but l cant solve this problem by documentatin or by google.

  {
  "include": ["src", "types"],
  "extends": "@snowpack/app-scripts-react/tsconfig.base.json",
  "compilerOptions": {
    // You can't currently define paths in your 'extends' config,
    // so we have to set 'baseUrl' & 'paths' here.
    // Don't change these unless you know what you're doing.
    // See: https://github.com/microsoft/TypeScript/issues/25430
    "baseUrl": "./",
    "paths": {
      "page/*": ["src/page/*"],
    }
  }
}

l use the this templete : app-template-react-typescript then l run yarn start

got this

✖ Package "page/Account" not found. Have you installed it?

looks like something wrong with the tsconfig , but how to fix it ,what is the corret tsconfig

FredKSchott commented 4 years ago

We don't currently support TSConfig paths, but we have a PR out to add: https://github.com/pikapkg/snowpack/pull/432

Until then, you'd need to import by "src/page/Account" for Snowpack to properly recognize it