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

Nested import.meta issue + no event trigger #400

Open
rafael-gal opened this issue Nov 14, 2023 · 4 comments
Open

Nested import.meta issue + no event trigger #400

rafael-gal opened this issue Nov 14, 2023 · 4 comments

Comments

@rafael-gal
Copy link

rafael-gal commented Nov 14, 2023

I've come across es-module-shims because I wanted to add <script type="importmap"></script> on an eletron app that has lower chromium version

image

I follow through Usage but I couldn't find a documentation or issue that relates to mine.

image

for the record I've tried adding simple module script like

<script type="module">
import { Component } from 'preact'
console.log('Component', Component)
</script>

It does work and shows loggings so it somehow runs but from my /app.js it shows the error

EDIT:
also tried it on shimMode using module-shim I've got these specific error on a normal web browser that support ESM

image

Original code is:

image

@rafael-gal
Copy link
Author

it turns out it's a nested dynamic-import issue same issue at #275 I was able to resolve the issue by doing

const __META__ = import.meta const MetaURL = ___META___.url const { name: ModuleName } = __MODULE__(MetaURL)

some issues still persist on ShimMode ON

Blank Display
image

ShimMode Off
Blank Display + 2 Relative references Error
image

@rafael-gal rafael-gal changed the title Missing ) after arguement list error Nested import.meta issue + Blank State Nov 14, 2023
@rafael-gal rafael-gal changed the title Nested import.meta issue + Blank State Nested import.meta issue + no event trigger Nov 14, 2023
@rafael-gal
Copy link
Author

Disregard my blank page. I was Adding my router in window.addEventListener( 'load' ) and it's not being triggered not even once.

@guybedford
Copy link
Owner

The specifier error is correct in polyfill mode, as the native loader has to fail before the polyfill kicks in. In both scenarios it seems you have a blank page?

It would be great if you could share the bug / error that points to import.meta as the issue here, and also share a replication for looking into it further.

@rafael-gal
Copy link
Author

The specifier error is correct in polyfill mode, as the native loader has to fail before the polyfill kicks in. In both scenarios it seems you have a blank page?

Yes, both page werre blank in both modes. It was my bad I was unsure of the problem at first but after using shim mode it points out the specific line where it failed. Its's all good.

It would be great if you could share the bug / error that points to import.meta as the issue here, and also share a replication for looking into it further.

I may have to get back with you for that and try If I can reproduce the issue on sandbox.

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

2 participants