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

parse error #81

Closed
davidmarkclements opened this issue Jul 13, 2021 · 2 comments
Closed

parse error #81

davidmarkclements opened this issue Jul 13, 2021 · 2 comments

Comments

@davidmarkclements
Copy link

davidmarkclements commented Jul 13, 2021

hey there, great work!

when attempting to parse https://github.com/pinojs/pino/blob/master/lib/tools.js the following error occurs:

Error: Parse error /example/node_modules/pino/lib/tools.js:1:1
    at Module.parse (file:///node_modules/es-module-lexer/dist/lexer.js:2:356)

If there's a way I can give you more info than this let me know

I realise it's a CJS file, but I'm parsing any file that may contain a dynamic import (which includes CJS files)

@guybedford
Copy link
Owner

@davidmarkclements thanks, nice to finally meet :) Just ran a quick test of this by pasting the source into the unit test file and running a parse. I needed to escape the backslashes and multiline comments to get it to parse correctly but that is standard literal string conversion. So it's defiitely working for me. Make sure you're passing a string and handling escaping correctly.

If you're still not able to get it to work, post a PR with a replication in test/_unit.cjs and I'll take another look.

@davidmarkclements
Copy link
Author

hey thanks for checking this, this was totally my fault (trying to lex a chunk of a stream without realising it). Sorry for the time drain!

great to meet you too, would love to meet in person at some point

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