Git Product home page Git Product logo

Comments (9)

tomwanzek avatar tomwanzek commented on July 18, 2024

Could you specify more context regarding how you ended up with the above error message? It does not replicate for me. The index.ts file is in the root directory of the project, i.e. one level above /config.

And I have no occurrence of the error you describe.

I am working on Windows 10 w/ VSCode 1.12.1 locally. Similarly, Travis builds without issues.

from d3-ng2-service.

mikekov avatar mikekov commented on July 18, 2024

I use d3-ng2-service package in Angular2 app. I installed it with npm. Visual Studio Code (1.12.1 on Win10) then shows me this error message:

file: 'file:///c%3A/xxxx/node_modules/ngx-cookie/tsconfig.json'
severity: 'Error'
message: 'File 'c:/xxxx/node_modules/ngx-cookie/index.ts' not found.'
at: '1,1'
source: 'ts'

It's benign, nothing's failing in my app. It shows up in the "Problems" panel.

I have just tried "npm install d3-ng2-service" in an empty folder. Today this ends up installing [email protected]. If I check node_modules\d3-ng2-service folder I'll find index.d.ts there, but not index.ts.

Hope this helps.

from d3-ng2-service.

tomwanzek avatar tomwanzek commented on July 18, 2024

A couple of things: First of, your latest error message actually refers to an ngx-cookie package.
As for the d3-ng2-service, sorry for not realizing right away that you were referring to the installed package built for consumption, rather than the cloned/forked package.

The package is distributed as a JS ES2015 module with accompanying d.ts for definitions, i.e. it is already compiled from TypeScript. So, I suspect in your project setup (VS Code settings) there is an issue with the compilation scope of your Angular app (tsconfig.json inclusions/exclusions/files and the like). Possibly it tries to "re-compile" dependencies and therefore runs into the issue with the missing index.ts files for both d3-ng2-service and ngx-cookie?

Let me know, if that idea gets you on the right path. I do not believe, the issue lies with this service, but if the hint does not do it, I would need a public repo which reproduces the error to check.

from d3-ng2-service.

mikekov avatar mikekov commented on July 18, 2024

Oops, copied wrong line... Yes, both packages have this issue in my VS Code project.

Thanks for your suggestion, I modified a few files to resolve this issue and problem went away.
I excluded node_modules in tsconfig.json in my app, and for a good measure I added **/node_modules/** to workspace settings for files.exclude and tslint.exclude.

After reopening my project VS Code is no longer scanning/complaining about neither d3-ng2-service nor ngx-cookie lib.

from d3-ng2-service.

tomwanzek avatar tomwanzek commented on July 18, 2024

Glad it worked. I will close the issue here. 💃

from d3-ng2-service.

mikekov avatar mikekov commented on July 18, 2024

Maybe I spoke too soon. While the error is initially gone after restarting VS Code, I think I have a way of triggering it. All it takes is to go to my source file with a reference to the D3Service and press F12 (browse symbol) to show symbol declaration. As soon as d3.service.d.ts file is open, familiar error pops up:

file: 'file:///c%3A/xxxx/node_modules/d3-ng2-service/tsconfig.json' severity: 'Error' message: 'File 'c:/xxxx/node_modules/d3-ng2-service/configs/../index.ts' not found.' at: '1,1' source: 'ts'

If I really want to silence this error, I need to create empty index.ts file inside node_modules\d3-ng2-service.
It appears intellisense engine in VS Code goes after tsconfig.json in node_modules\d3-ng2-service, finds node_modules\d3-ng2-service\configs\base.json and tries to locate missing index.ts that base.json refers to.
I couldn't find any VS Code settings to configure intellisense.

from d3-ng2-service.

tomwanzek avatar tomwanzek commented on July 18, 2024

I am reopening and will push a fix with a patch release right after. The tsconfig-related files made their way into the npm package unnecessarily. I recently changed the build pipeline and did not updated the npm .npmignore file.

@mikekov Thanks for the persistence 👍

from d3-ng2-service.

tomwanzek avatar tomwanzek commented on July 18, 2024

With Release 1.10.2 the issue is resolved.

from d3-ng2-service.

mikekov avatar mikekov commented on July 18, 2024

Thank you very much for your prompt action. Yes, I can confirm that VS Code is happy now with package 1.10.2 when browsing symbols. No more error messages.

from d3-ng2-service.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.