Typescript error when running Looback v4 project












0















I have been running the same Loopback 4 projects on my PC for months, but a couple of days ago I start getting Typescript problems that I cannot find a resolution to.



When trying to run NPM START, I'm getting the following Typescript:




node_modules/@loopback/core/dist/src/keys.d.ts(27,40): error TS1005:
'>' expected. node_modules/@loopback/core/dist/src/keys.d.ts(27,103):
error TS1109: Expression expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(11,62):
error TS1144: '{' or ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,5):
error TS1128: Declaration or statement expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,39):
error TS1005: ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(13,1):
error TS1128: Declaration or statement expected.




The same code (project) runs just fine on another PC, so I'm thinking this is related to Typescript, but I have not been able to figure out the root cause, and therefore find a resolution on my own.



Update:
I tried to run NPM UPDATE on my working environment, and it broke too, with the same TS-problems.



Maybe it's my package.json file, it was scaffolded using an beta-version of LB4, and manually updated.



"@loopback/boot": "^1.0.5",
"@loopback/context": "^1.1.0",
"@loopback/core": "^1.1.0",
"@loopback/openapi-v3": "^1.1.2",
"@loopback/openapi-v3-types": "^1.0.1",
"@loopback/repository": "^1.0.5",
"@loopback/rest": "^1.3.1",
"@loopback/rest-explorer": "^1.1.1",
"@loopback/service-proxy": "^1.0.2",









share|improve this question

























  • Did you try to update all your dependencies to the latest versions? npm update

    – Miroslav Bajtoš
    Nov 26 '18 at 13:32











  • Did you resolve this issue?

    – Ashutosh Chamoli
    Nov 27 '18 at 15:21











  • Thanks for suggestions, but no success so far. See updated article

    – LarsM
    Nov 27 '18 at 17:18
















0















I have been running the same Loopback 4 projects on my PC for months, but a couple of days ago I start getting Typescript problems that I cannot find a resolution to.



When trying to run NPM START, I'm getting the following Typescript:




node_modules/@loopback/core/dist/src/keys.d.ts(27,40): error TS1005:
'>' expected. node_modules/@loopback/core/dist/src/keys.d.ts(27,103):
error TS1109: Expression expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(11,62):
error TS1144: '{' or ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,5):
error TS1128: Declaration or statement expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,39):
error TS1005: ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(13,1):
error TS1128: Declaration or statement expected.




The same code (project) runs just fine on another PC, so I'm thinking this is related to Typescript, but I have not been able to figure out the root cause, and therefore find a resolution on my own.



Update:
I tried to run NPM UPDATE on my working environment, and it broke too, with the same TS-problems.



Maybe it's my package.json file, it was scaffolded using an beta-version of LB4, and manually updated.



"@loopback/boot": "^1.0.5",
"@loopback/context": "^1.1.0",
"@loopback/core": "^1.1.0",
"@loopback/openapi-v3": "^1.1.2",
"@loopback/openapi-v3-types": "^1.0.1",
"@loopback/repository": "^1.0.5",
"@loopback/rest": "^1.3.1",
"@loopback/rest-explorer": "^1.1.1",
"@loopback/service-proxy": "^1.0.2",









share|improve this question

























  • Did you try to update all your dependencies to the latest versions? npm update

    – Miroslav Bajtoš
    Nov 26 '18 at 13:32











  • Did you resolve this issue?

    – Ashutosh Chamoli
    Nov 27 '18 at 15:21











  • Thanks for suggestions, but no success so far. See updated article

    – LarsM
    Nov 27 '18 at 17:18














0












0








0








I have been running the same Loopback 4 projects on my PC for months, but a couple of days ago I start getting Typescript problems that I cannot find a resolution to.



When trying to run NPM START, I'm getting the following Typescript:




node_modules/@loopback/core/dist/src/keys.d.ts(27,40): error TS1005:
'>' expected. node_modules/@loopback/core/dist/src/keys.d.ts(27,103):
error TS1109: Expression expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(11,62):
error TS1144: '{' or ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,5):
error TS1128: Declaration or statement expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,39):
error TS1005: ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(13,1):
error TS1128: Declaration or statement expected.




The same code (project) runs just fine on another PC, so I'm thinking this is related to Typescript, but I have not been able to figure out the root cause, and therefore find a resolution on my own.



Update:
I tried to run NPM UPDATE on my working environment, and it broke too, with the same TS-problems.



Maybe it's my package.json file, it was scaffolded using an beta-version of LB4, and manually updated.



"@loopback/boot": "^1.0.5",
"@loopback/context": "^1.1.0",
"@loopback/core": "^1.1.0",
"@loopback/openapi-v3": "^1.1.2",
"@loopback/openapi-v3-types": "^1.0.1",
"@loopback/repository": "^1.0.5",
"@loopback/rest": "^1.3.1",
"@loopback/rest-explorer": "^1.1.1",
"@loopback/service-proxy": "^1.0.2",









share|improve this question
















I have been running the same Loopback 4 projects on my PC for months, but a couple of days ago I start getting Typescript problems that I cannot find a resolution to.



When trying to run NPM START, I'm getting the following Typescript:




node_modules/@loopback/core/dist/src/keys.d.ts(27,40): error TS1005:
'>' expected. node_modules/@loopback/core/dist/src/keys.d.ts(27,103):
error TS1109: Expression expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(11,62):
error TS1144: '{' or ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,5):
error TS1128: Declaration or statement expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(12,39):
error TS1005: ';' expected.
node_modules/@loopback/rest/dist/src/router/trie-router.d.ts(13,1):
error TS1128: Declaration or statement expected.




The same code (project) runs just fine on another PC, so I'm thinking this is related to Typescript, but I have not been able to figure out the root cause, and therefore find a resolution on my own.



Update:
I tried to run NPM UPDATE on my working environment, and it broke too, with the same TS-problems.



Maybe it's my package.json file, it was scaffolded using an beta-version of LB4, and manually updated.



"@loopback/boot": "^1.0.5",
"@loopback/context": "^1.1.0",
"@loopback/core": "^1.1.0",
"@loopback/openapi-v3": "^1.1.2",
"@loopback/openapi-v3-types": "^1.0.1",
"@loopback/repository": "^1.0.5",
"@loopback/rest": "^1.3.1",
"@loopback/rest-explorer": "^1.1.1",
"@loopback/service-proxy": "^1.0.2",






loopbackjs v4l2loopback






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 27 '18 at 16:55







LarsM

















asked Nov 24 '18 at 22:11









LarsMLarsM

444




444













  • Did you try to update all your dependencies to the latest versions? npm update

    – Miroslav Bajtoš
    Nov 26 '18 at 13:32











  • Did you resolve this issue?

    – Ashutosh Chamoli
    Nov 27 '18 at 15:21











  • Thanks for suggestions, but no success so far. See updated article

    – LarsM
    Nov 27 '18 at 17:18



















  • Did you try to update all your dependencies to the latest versions? npm update

    – Miroslav Bajtoš
    Nov 26 '18 at 13:32











  • Did you resolve this issue?

    – Ashutosh Chamoli
    Nov 27 '18 at 15:21











  • Thanks for suggestions, but no success so far. See updated article

    – LarsM
    Nov 27 '18 at 17:18

















Did you try to update all your dependencies to the latest versions? npm update

– Miroslav Bajtoš
Nov 26 '18 at 13:32





Did you try to update all your dependencies to the latest versions? npm update

– Miroslav Bajtoš
Nov 26 '18 at 13:32













Did you resolve this issue?

– Ashutosh Chamoli
Nov 27 '18 at 15:21





Did you resolve this issue?

– Ashutosh Chamoli
Nov 27 '18 at 15:21













Thanks for suggestions, but no success so far. See updated article

– LarsM
Nov 27 '18 at 17:18





Thanks for suggestions, but no success so far. See updated article

– LarsM
Nov 27 '18 at 17:18












1 Answer
1






active

oldest

votes


















1














So - I finally figured out the reason behind my problems.



My project was scaffolded with an early version of the Loopback/cli back in July 2018, and the logic regarding the dist folder was changed in index.js.



Some time during the last couple of weeks, a new logic has replaced the old dist-util, and this change broke my project.



I'm back now, but I have one un-resolved issue with the query parameter of Restbindings being empty. I will open a new thread for that.






share|improve this answer
























  • While giving a useful hint you should clarify your answer with the solution: Update the dependencies! I ran into the same problem.

    – Peter Thomas Horn
    Dec 1 '18 at 16:52











  • Ok, so my problem was primarily caused by the build-logic being changed in the GA release. In the pre-release setup, the @loopback/dist-util determined if the prod-files should go to dist8 or dist10, while the GA version is using dist regardless. My fix was to create a new app with the cli from the GA release, and replace my old index.js file with the new one. Hope this helps.

    – LarsM
    Dec 2 '18 at 17:19













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462789%2ftypescript-error-when-running-looback-v4-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














So - I finally figured out the reason behind my problems.



My project was scaffolded with an early version of the Loopback/cli back in July 2018, and the logic regarding the dist folder was changed in index.js.



Some time during the last couple of weeks, a new logic has replaced the old dist-util, and this change broke my project.



I'm back now, but I have one un-resolved issue with the query parameter of Restbindings being empty. I will open a new thread for that.






share|improve this answer
























  • While giving a useful hint you should clarify your answer with the solution: Update the dependencies! I ran into the same problem.

    – Peter Thomas Horn
    Dec 1 '18 at 16:52











  • Ok, so my problem was primarily caused by the build-logic being changed in the GA release. In the pre-release setup, the @loopback/dist-util determined if the prod-files should go to dist8 or dist10, while the GA version is using dist regardless. My fix was to create a new app with the cli from the GA release, and replace my old index.js file with the new one. Hope this helps.

    – LarsM
    Dec 2 '18 at 17:19


















1














So - I finally figured out the reason behind my problems.



My project was scaffolded with an early version of the Loopback/cli back in July 2018, and the logic regarding the dist folder was changed in index.js.



Some time during the last couple of weeks, a new logic has replaced the old dist-util, and this change broke my project.



I'm back now, but I have one un-resolved issue with the query parameter of Restbindings being empty. I will open a new thread for that.






share|improve this answer
























  • While giving a useful hint you should clarify your answer with the solution: Update the dependencies! I ran into the same problem.

    – Peter Thomas Horn
    Dec 1 '18 at 16:52











  • Ok, so my problem was primarily caused by the build-logic being changed in the GA release. In the pre-release setup, the @loopback/dist-util determined if the prod-files should go to dist8 or dist10, while the GA version is using dist regardless. My fix was to create a new app with the cli from the GA release, and replace my old index.js file with the new one. Hope this helps.

    – LarsM
    Dec 2 '18 at 17:19
















1












1








1







So - I finally figured out the reason behind my problems.



My project was scaffolded with an early version of the Loopback/cli back in July 2018, and the logic regarding the dist folder was changed in index.js.



Some time during the last couple of weeks, a new logic has replaced the old dist-util, and this change broke my project.



I'm back now, but I have one un-resolved issue with the query parameter of Restbindings being empty. I will open a new thread for that.






share|improve this answer













So - I finally figured out the reason behind my problems.



My project was scaffolded with an early version of the Loopback/cli back in July 2018, and the logic regarding the dist folder was changed in index.js.



Some time during the last couple of weeks, a new logic has replaced the old dist-util, and this change broke my project.



I'm back now, but I have one un-resolved issue with the query parameter of Restbindings being empty. I will open a new thread for that.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 27 '18 at 23:02









LarsMLarsM

444




444













  • While giving a useful hint you should clarify your answer with the solution: Update the dependencies! I ran into the same problem.

    – Peter Thomas Horn
    Dec 1 '18 at 16:52











  • Ok, so my problem was primarily caused by the build-logic being changed in the GA release. In the pre-release setup, the @loopback/dist-util determined if the prod-files should go to dist8 or dist10, while the GA version is using dist regardless. My fix was to create a new app with the cli from the GA release, and replace my old index.js file with the new one. Hope this helps.

    – LarsM
    Dec 2 '18 at 17:19





















  • While giving a useful hint you should clarify your answer with the solution: Update the dependencies! I ran into the same problem.

    – Peter Thomas Horn
    Dec 1 '18 at 16:52











  • Ok, so my problem was primarily caused by the build-logic being changed in the GA release. In the pre-release setup, the @loopback/dist-util determined if the prod-files should go to dist8 or dist10, while the GA version is using dist regardless. My fix was to create a new app with the cli from the GA release, and replace my old index.js file with the new one. Hope this helps.

    – LarsM
    Dec 2 '18 at 17:19



















While giving a useful hint you should clarify your answer with the solution: Update the dependencies! I ran into the same problem.

– Peter Thomas Horn
Dec 1 '18 at 16:52





While giving a useful hint you should clarify your answer with the solution: Update the dependencies! I ran into the same problem.

– Peter Thomas Horn
Dec 1 '18 at 16:52













Ok, so my problem was primarily caused by the build-logic being changed in the GA release. In the pre-release setup, the @loopback/dist-util determined if the prod-files should go to dist8 or dist10, while the GA version is using dist regardless. My fix was to create a new app with the cli from the GA release, and replace my old index.js file with the new one. Hope this helps.

– LarsM
Dec 2 '18 at 17:19







Ok, so my problem was primarily caused by the build-logic being changed in the GA release. In the pre-release setup, the @loopback/dist-util determined if the prod-files should go to dist8 or dist10, while the GA version is using dist regardless. My fix was to create a new app with the cli from the GA release, and replace my old index.js file with the new one. Hope this helps.

– LarsM
Dec 2 '18 at 17:19






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53462789%2ftypescript-error-when-running-looback-v4-project%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'