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

ESM broken since version 1.2.1 #13

Closed
diegone opened this issue Mar 2, 2022 · 3 comments
Closed

ESM broken since version 1.2.1 #13

diegone opened this issue Mar 2, 2022 · 3 comments

Comments

@diegone
Copy link

diegone commented Mar 2, 2022

CJS require works but ESM import throws an exception from version 1.2.1 to 1.2.3. Version 1.2.0 works fine.

@kefniark
Copy link
Contributor

kefniark commented Mar 2, 2022

Can you explain more about the error you get and how you are using it?

I just tested the last version with a simple HTML code and <script type="module"> and it work without any trouble with the ESM file.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
  </head>
  <body>
    <script type="module">
      import { detect } from './dist/tinyld.esm.js'

      console.log(detect('test my text'))
    </script>
  </body>
</html>

@diegone
Copy link
Author

diegone commented Mar 2, 2022

Sorry, I should have been more specific. This happened to me using Node.js 16.13.1. If I do import('tinyld') from the REPL or import tinild from 'tinild' from my module, I get a dump of the source and a SyntaxError: Unexpected token 'export' exception. The same works fine with 1.2.0.

@kefniark
Copy link
Contributor

kefniark commented Jul 23, 2022

This should be solved in last version 👍

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