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

Imported modules do not work on ws handlers #70

Closed
1 of 2 tasks
kran6a opened this issue Aug 2, 2020 · 4 comments
Closed
1 of 2 tasks

Imported modules do not work on ws handlers #70

kran6a opened this issue Aug 2, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@kran6a
Copy link

kran6a commented Aug 2, 2020

Bug Report

Is you/your team sponsoring this project

  • Yes
  • No

Minimal reproducible repo

https://github.com/kran6a/nanoexpress-bug-2

Current Behavior

Creating a websocket handler that needs to use imported dependencies causes the server to crash when a ws message is received by the server with a ReferenceError: is not defined.

I suspect the error is caused by an eval() or a Function constructor using the relative path of the imported module.

Expected behavior/code

Using imported modules and constants on route handlers should work the same way it works on HTTP routes.

Environment

  • Node/npm version: Node 14.5.0/npm 6.14.5
  • OS: Debian
@kran6a kran6a added the bug Something isn't working label Aug 2, 2020
@dalisoft
Copy link
Member

dalisoft commented Aug 2, 2020

Hi. see https://t.me/nanoexpress/18.
I am not maintaining this framework anymore, exactly i will add new features and quick bug fixes only for commercial users.

Thanks for bug reporting

@dalisoft dalisoft closed this as completed Aug 2, 2020
@dalisoft dalisoft reopened this Sep 4, 2020
@dalisoft
Copy link
Member

@kran6a Sorry for delay, can you please describe issue more informative? Thanks

@dalisoft
Copy link
Member

Hi, @kran6a
Good find, thanks for trying out nanoexpress. Fix soon will be released.
Have a nice day!

@dalisoft
Copy link
Member

@kran6a
Issue fixed, just use nanoexpress instead of nanoexpress-pro as now aliased

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

No branches or pull requests

2 participants