Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import '@stencil/router'; #96

Open
stefanhuber opened this issue Jun 4, 2019 · 8 comments
Open

import '@stencil/router'; #96

stefanhuber opened this issue Jun 4, 2019 · 8 comments

Comments

@stefanhuber
Copy link

It should be mentioned somewhere that the router needs to be imported within the root stencil component otherwise nothing works. This is IMHO not documented anywhere...

import '@stencil/router'; 
@warapitiya
Copy link

@shallurohilla Thank you for posting it here at least.

@shreeshbhat
Copy link

This issue tripped me up too.
Must be documented indeed 👍

@PurpleEdge2214
Copy link

Where is it imported in the default application?

Can you give an example of what doesn't work without the import?

I'm asking because the stenciljs documentation is so thin I'm not sure what I'm missing out on!

@stefanhuber
Copy link
Author

I don't know what you mean by the default application, however if you take a look at the stencil-site it is imported inside the app-root component:
https://github.com/ionic-team/stencil-site/blob/master/src/components/app-root/app-root.tsx

@PurpleEdge2214
Copy link

Thanks @stephanhuber, we must be talking about different things?

npm init stencil
pwa

...doesn't create anything like that?

@sniederb
Copy link

Just cost me more than 1h to figure this out. What's remarkable is that in the demo, src/components.d.ts does import @stencil/router, but this is a generated file. The root tsx, src/components/router-demo-app.tsx, is lacking that import statement.

@ianemv
Copy link

ianemv commented Sep 30, 2020

Thanks for sharing. Using this for component

@AlexSapoznikov
Copy link

JEEZ, I spent about an hour just trying to figure out why nothing works. Thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants