intellij does not import member of javascript module

Answered

I made a test.mjs in a directory (export const a = 1;)

and I tried to use 'import { } from './test.mjs'; and Ctrl+space

it does not show a variable

0
14 comments

Could you please provide a screenshot showing the mentioned source file and the project structure in IntelliJ - showing the file?
Also, please provide your log files (Help > Collect Logs and Diagnostic Data). You can upload the zip file here.

Just provide the uploaded file ID. Thanks!

0

zip all? could you list file name?
I uploaded screenshots :>

2023_02_20_eEodHqE9qz1sS2J9nkbA8D

0

When you execute Help > Collect Logs and Diagnostic Data there should be one .zip file generated and selected automatically in your file explorer.
It is called similar to this: idea-logs-<date>-<time>.zip. Please upload this file to our server: https://uploads.jetbrains.com
On the screenshot, I cannot see the test.mjs file. Is it possible to also share the zipped project folder - so that we can try to reproduce the issue on our side? Thanks!

0

I uploaded

2023_02_20_D7UgnVxANkwsKX7yXE6YPE

0

Thanks for the logs. 
Is it possible to share also the zipped project folder? To check the project configuration and structure?
And to try to reproduce on our side.

0

of course, there is no test.mjs because it was just for test. and it did not work

2023_02_20_5sfoixo1C7YXVcSWVg4f72

here

0

And I'm using vscode for javascript now. it works well

0

it works fine for me when using your code snippet and steps:

could you check if you can reproduce the issue in a new empty project, after adding test.mjs to it?

0

as you mentioned, I do 'new project' -> select javascript, then it works too like it.

In case of the project having problem about this post,

I made a directory(rust-solana project) -> init npm to use javascript also

I think intellij want to think it is not javascript project

0

Please could you share a complete project you have issues with, including the .idea folder?

0

Here

2023_02_22_L5uULqBhamocLr1co2EKSf

0

your .idea files are likely broken,  the modules.xml is missing. Deleting and re-creating .idea folder should help:

  • close the project
  • remove it from Recent projects list
  • shut down the IDE
  • delete the .idea folder and the *.iml files (if any)
  • restart, open the project root folder with File > Open

 

0

Thanks! it works

Could you check @solana/web3.js ?
I think it does not work with autocomplete

0

Please sign in to leave a comment.