Skip to content

Devtools blocks importmap from working #464

Description

@NTICompass

Describe the bug
Sometimes, usually when loading a page from the "new tab" page, I get errors in my JavaScript and my page won't load.

I see:

Import maps are not allowed after a module load or preload has started.
Uncaught TypeError: The specifier “es-toolkit” was a bare specifier, but was not remapped to anything. Relative module specifiers must start with “./”, “../” or “/”.

This only happens on the first load. If I hit reload, then everything is fine. I'm not 100% sure this extension is the issue, but when I disabled it, I couldn't make the issue happen.

Device information (please complete the following information):

  • OS: Fedora 43 + KDE
  • Browser Zen 1.18.5b (Firefox 147.0.3)
  • Extension version 2.7.4
  • Alpine.js version 3.15.8

Code sample

<script type="importmap">
    {
        "imports": {
            "es-toolkit": "https://cdn.jsdelivr.net/npm/es-toolkit@1.44/+esm",
            "handlebars": "https://cdn.jsdelivr.net/npm/handlebars@4/runtime.js/+esm"
        }
    }
</script>
<script type="module">
    import { toMerged } from 'es-toolkit';
    
    // Code using `toMerged()`
</script>

To Reproduce
Steps to reproduce the behavior:

  1. Open my website from the bookmarks bar on the new tab page
  2. See that the page isn't loaded correctly
  3. See errors in the console
  4. On a reload, everything is fine

Expected behavior
The alpine devtools doesn't crash my page

Additional context
I don't know why the alpine devtools seems to be causing this issue, but with the extension disabled I never get the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions