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

The “/esm” directory cannot load via a “module” import. #657

Open
theengineear opened this issue Oct 4, 2024 · 0 comments
Open

Comments

@theengineear
Copy link

👋 — Hi there! I was hoping to be able to leverage rdflib to visualize some modeling problems I’m working on in a browser. However, when I went to get started, I couldn’t get it loading via the exported /esm scripts. E.g., this doesn’t work:

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>rdflib demo</title>
    <script type="module" src="https://www.unpkg.com/[email protected]/esm/index.js"></script>
  </head>
  <body></body>
</html>

This will complain about @babel not existing, but I don’t believe an import map declaration to map the @babel bare module specifier to a well-defined resolution destination will work… If you look in https://www.unpkg.com/[email protected]/esm/index.js, you’ll see lines like:

import _createClass from "@babel/runtime/helpers/createClass";

But …createClass isn’t a real thing. You can find …createClass.js (https://www.unpkg.com/@babel/[email protected]/helpers/createClass.js), but because there’s no .js, the browser tries to lookup (https://www.unpkg.com/@babel/[email protected]/helpers/createClass). And… that doesn’t exist.

In other words, this doesn’t really help to do the following:

<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>rdflib demo</title>
    <script type="importmap">
      {
        "imports": {
          "@babel/runtime/": "https://www.unpkg.com/@babel/[email protected]/"
        }
      }
    </script>
    <script type="module" src="https://www.unpkg.com/[email protected]/esm/index.js"></script>
  </head>
  <body></body>
</html>

❤️ — Thanks for taking a look!

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