ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.5k stars 784 forks source link

Generated components.d.ts file is invalid in 0.0.8-9 #341

Closed cary-smith closed 6 years ago

cary-smith commented 6 years ago

Stencil version:

 @stencil/core@0.0.8-9

I'm submitting a:

Current behavior:

Unable to build project using stencil-component-starter. Compile errors: "tsHost.getSourceFile unable to find C:/Users/me/dev/stencil-component-starter/src/index.d.ts"

Expected behavior:

Should be able to run the app.

Steps to reproduce:

Just attempted to run npm start on the stencil-component-starter without any changes.

Related code: Looks like a typo for component paths? From the generated components.d.ts file:

import {
  MyComponent as MyComponent
} from './components\my-component\my-component';

This breaks the build.

cantsdmr commented 6 years ago

This './components\my-component\my-component' line has backslashes breaking the build. Changing the backslashes to forward slashes fixes the issue but I couldn't set up config that adds forward slashes automatically.

cary-smith commented 6 years ago

Definitely related to #344.

rolandjitsu commented 6 years ago

I'm having a similar issue, but I'm running on OS X and the path seems to be fine (the index.d.ts exists, but it's empty):

> @bbpviz/components@0.0.0 dev /Users/agroza/Projects/@bbpviz/components
> sd concurrent "stencil build --dev --watch" "stencil-dev-server"

[03:27.2]  @stencil/core v0.0.8-9
[03:27.5]  build, bbpviz, dev mode, started ...
[03:27.5]  compile started ...
[ ERROR ]  tsHost.getSourceFile unable to find /Users/agroza/Projects/@bbpviz/components/src/index.d.ts
[ ERROR ]  tsHost.getSourceFile unable to find /Users/agroza/Projects/@bbpviz/components/src/index.d.ts
[03:36.1]  compile finished in 8.56 s

[ ERROR ]  typescript error
           File '/Users/agroza/Projects/@bbpviz/components/src/index.d.ts' not found.

[03:36.4]  build failed, watching for changes... in 8.84 s
jgw96 commented 6 years ago

Thanks for opening an issue with us, I will look into this.

jgw96 commented 6 years ago

Hey all! I just fixed this here https://github.com/ionic-team/stencil/commit/c327eb01ea5c3529f88ea3767a81946523b9b7c8 and this fix will be in the next release (which should happen this afternoon). Thanks for using Stencil!