Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing modules using import maps in the client #2193

Open
dkolba opened this issue Dec 23, 2023 · 0 comments
Open

Importing modules using import maps in the client #2193

dkolba opened this issue Dec 23, 2023 · 0 comments

Comments

@dkolba
Copy link

dkolba commented Dec 23, 2023

Is it supported to use <script type="importmap"> within a component during development?

I always get An import map is added after module script load was triggered. in the browser console while running in dev mode. Import maps seem to expect to be loaded before everything else on the page and fresh_dev_client.js is always the very first script being loaded.

        <script
          type="importmap"
          dangerouslySetInnerHTML={{
            __html: '{ "imports": { "a": "/a.js"} }',
          }}
        />
        <script
          type="module"
          dangerouslySetInnerHTML={{
            __html: `
              import { a } from "a";
            `,
          }}
        />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant