Skip to content

Uncaught Error: Dynamic require of “events” is not supported #95

@JangTaewan

Description

@JangTaewan

Hello,

I’m using your node-snap7 package in a Vite project and I’ve encountered an issue. When I try to run my project, I get the following error:

Uncaught Error: Dynamic require of "events" is not supported
at chunk-6NOISVLF.js?v=2f01d05e:10:9
at node_modules/.vite-electron-renderer/events.mjs (events.mjs:1:50)
at __init (chunk-6NOISVLF.js?v=2f01d05e:13:56)
at node_modules/node-snap7/lib/node-snap7.js (node-snap7.js:6:14)
at __require2 (chunk-6NOISVLF.js?v=2f01d05e:16:50)
at node-snap7.js:59:78

It seems like the issue is related to the dynamic require of “events”. I understand that Vite prefers ES6 import syntax over CommonJS require, which might be causing this issue.Do you know any solutions to this problem?Thank you for your time and for the work you’ve put into this package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions