question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:

  1. Create a HTML File with <script type="module">...</script>
  2. Add // @ts-check and import any npm package
  3. 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: 1

It is not working in .html however: 2

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:

  1. Created a jsconfig.json file
  2. Tried the above error suggestions.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
ObscurusGrassatorcommented, Feb 4, 2021

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

0reactions
NWYLZWcommented, Oct 23, 2022

Window is the default type that does not compute?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found