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

Social network example is failing #239

Closed
fmvilas opened this issue Jan 22, 2022 · 2 comments · Fixed by #251
Closed

Social network example is failing #239

fmvilas opened this issue Jan 22, 2022 · 2 comments · Fixed by #251
Labels
bug Something isn't working released

Comments

@fmvilas
Copy link
Member

fmvilas commented Jan 22, 2022

Describe the bug

The example at examples/social-network is failing.

How to Reproduce

Try going to this folder, and running npm run dev on any of the Glee apps.

It fails because the lowdb package is an ES Module (those using import instead of require) and we're compiling all the Typescript code (except node_modules) to CommonJS modules (those using require instead of import). Therefore, it doesn't expect an import keyword and fails.

Expected behavior

It should support ES Modules out of the box. There will be more and more packages migrating to ES Modules over time as it's the new standard. ES modules can import CommonJS modules but CommonJS modules can't require ES Modules.

It should be easy to do. Initially, Glee supported them very well but after the Typescript migration (#212 and #213) it got broken. Changing all the code to ES Modules (and adding back .js extension to all imports) should be fine except for Jest mock of fs/promises in the test/lib/functions.test.ts file, which doesn't work yet with ESM.

I think a good and quick solution would be to just get rid of this test for now until Jest supports ESM. Check the progress (or even better, contribute) at jestjs/jest#10976.

@fmvilas fmvilas added the bug Something isn't working label Jan 22, 2022
@sudoshreyansh
Copy link
Contributor

I would like to work on this issue.

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 0.10.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants