[html] support imports in embedded JavaScript
See original GitHub issue- VSCode Version: 1.52.1
- OS Version: Windows 10.0.19042.685
Steps to Reproduce:
- Create a HTML File with
<script type="module">...</script>
- Add
// @ts-check
and import any npm package - No intellisense
Does this issue occur when all extensions are disabled?: Yes
If we would do the same steps with a .js file, IntelliSense will work:
It is not working in .html however:
Error:
Cannot find module 'hydro-js'. Did you mean to set the 'moduleResolution' option to 'node', or to add aliases to the 'paths' option?javascript
Tried troubleshooting:
- Created a jsconfig.json file
- Tried the above error suggestions.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:5 (1 by maintainers)
Top Results From Across the Web
import - JavaScript - MDN Web Docs - Mozilla
The static import declaration is used to import read-only live bindings which are exported by another module. The imported bindings are ...
Read more >HTML Imports - web.dev
HTML Imports, part of the Web Components cast, is a way to include HTML documents in other HTML documents. You're not limited to...
Read more >HTML5 Imports: Import HTML Files Into HTML Files
It didn't allow the embedding of HTML files, though. To achieve that we were limited to the „iframes“ element or the JavaScript method ......
Read more >Understanding Modules and Import and Export Statements ...
In the early days of the Web, websites consisted primarily of HTML and CSS. If any JavaScript loaded into a page at all,...
Read more >Inlining ECMAScript Modules in HTML - javascript
Hacking Together Our Own import from '#id'. Exports/imports between inline scripts aren't natively supported, but it was a fun exercise to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The principle of JSDoc is to document JavaScript code and help developers in the IDE. It doesn’t matter where the JavaScript is located. Not supporting import in HTML files is a HUGE ISSUE. The HTML file is the originator of the JavaScript. Please plan to add this functionality, or let me contact the person who has it in its power and I may be able to change your priorities. Thank you
Window
is the default type that does not compute?