tvcutsem / harmony-reflect

ES5 shim for ES6 Reflect and Proxy objects
http://www.ecma-international.org/ecma-262/6.0/#sec-reflection
Other
478 stars 48 forks source link

Index not found #83

Closed vicasas closed 3 years ago

vicasas commented 3 years ago

When creating a jsconfig.json file I get the error

File '/home/myproject/node_modules/harmony-reflect/index' not found. The file is in the program because: Root file specified for compilationts

vicasas commented 3 years ago

I reopened editor and the problem was solved.

mpizzaca commented 3 years ago

I am getting this same issue. Reopning the editor works temporarily but the issue comes back.

vicasas commented 3 years ago

@mpizzaca Exactly. It looks like a vscode error in reading the file.

tvcutsem commented 3 years ago

I tried reproducing this by upgrading to latest vscode, creating an empty new project directory, creating a jsconfig.json file and npm installing the latest harmony-reflect package. When creating new JS source files in this project, I don't see any error. Can you reproduce your problem in a minimal project setup?

Also, have you excluded your "node_modules" directory from your jsconfig file as recommended in the vscode docs? See https://code.visualstudio.com/docs/languages/jsconfig#_using-the-exclude-property for how to do this.

As I understand it, jsconfig.json is meant to create a JS project context in vscode. Files from installed packages under node_modules should not be treated as part of your own project codebase.

mpizzaca commented 3 years ago

Having trouble reproducing it as it seems to pop up only after some time. I suspect excluding node_modules will resolve it, thanks for that.

I noticed other repos using "typings": "index.d.ts" vs "typings": "index" in package.json - this might be confusing VSCode?

tvcutsem commented 3 years ago

Good remark about the "typings" field. I suspect that may indeed be the issue if other modules are not causing this problem. I will update the typings field accordingly.

tvcutsem commented 3 years ago

I released v1.6.2 with a fix. Closing this issue. Let me know if neither this fix nor excluding the package from jsconfig.json solves the problem.

vicasas commented 3 years ago

When updating to the new version at the moment there is no problem. Thanks.