sinclairnick / webroute

🕸️ Web APIs, from the route up
https://webroute.vercel.app/docs
MIT License
55 stars 2 forks source link

Use commonjs dist file as export for "require" #37

Closed jasongwartz closed 2 months ago

jasongwartz commented 2 months ago

This fixes error SyntaxError: Cannot use import statement outside a module when trying to use @webroute/route in a CommonJS context.

I didn't check to see if this affects other packages in the repo as well.

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
webroute ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 9, 2024 1:28pm
sinclairnick commented 2 months ago

Great catch Jason. Thanks.

I should add more tests for different environments, runtimes, etc. at some point

sinclairnick commented 2 months ago

Hey @jasongwartz apologies for not publishing at time of merging this. I've published a new @webroute/route package now with these, and few other minor changes. So if you were prevented due to the commonjs issue you should be clear now.

Please let me know if the issue still isn't resolved.