-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
aurelia-cli beta 1.7/typescript 3.2.2 activationStrategy not allowed in router.config #628
Comments
Can you show more details? It looks like a syntax error |
Sorry - that was my bad typing. This was the actual code. I removed activationStrategy and it compiles now.
|
Sorry, I am not TS user. But can you try TS v3.1.6 + cli beta7? It could be the same reason for the bluebird import failure. |
I suspect it was the upgrade to TS 3.2.2 - Stupidly I did them both at the same time. Each time I upgrade TS it finds more errors in my code (good thing!). |
Based on the d.ts file, I guess you need to do import {activationStrategy} from 'aurelia-router';
... activationStrategy: activationStrategy.replace, |
|
OK - so it's just a problem in the d-ts. Need to change it to |
Sorry - misspoke. It is correct in the d.ts. Can't see why it throws an error for 'replace'. |
The router typings are correct. This is a bug or a quirk, depending on how positive you are, in TypeScript itself. See microsoft/TypeScript#10570.
What happens is that when you write the above TypeScript infers a type from the route config object literal and then tries to match it up with Workaround
For now, this will work. You could also cast just the Fix We need to drop the string literal typing in favor of either a string or an enum-like. |
I think this was fixed in the latest version of TS, wasn't it? |
Haven't seen that. Issue is still open in MS repo and upgrading to latest is what brought my attention to this issue. |
I had this issue and got around with |
I'm submitting a bug report
aurelia-cli 1.0.7 beta
Please tell us about your environment:
Operating System:
Windows 10
Node Version:
10.11.0
Yarn Version:
1.12.3
JSPM OR Webpack AND Version
Webpack 4.27.1
Browser:
Chrome 70.0.3538.110
Language:
TypeScript 3.2.2
Current behavior:
Just ran
yarn upgrade
. It updated aurelia-cli from beta 5 to to beta 7au build
fails to compile onroute.config[map ..... activationStrategy:'replace".....
Expected/desired behavior:
It should compile
What is the expected behavior?
What is the motivation / use case for changing the behavior?
The text was updated successfully, but these errors were encountered: