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

Not finding solution #92

Open
Becca-Ro opened this issue Jan 23, 2025 · 0 comments
Open

Not finding solution #92

Becca-Ro opened this issue Jan 23, 2025 · 0 comments

Comments

@Becca-Ro
Copy link

Next.js has the ability to add polyfills to node builtin modules, so there doesn't seem to be any problem.
When building as a browser target when using esbuild or rollup, a problem appears to occur with loading Buffer from the global, which requested from safe-buffer ( a dependency of iconv-lite)
Injecting polyfill will help this problem (e.g. https://www.npmjs.com/package/esbuild-plugin-polyfill-node), however, I'll investigate if can patch iconv-lite to make it easier for end-users to use.
Originally posted by @seokju-na in #62

Hello!! I'm not familiar with this tipe of library, what im supposed to do with the code presented in "Usage"?

is there no other solution?

im getting all this errors:
Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
at node_modules/safer-buffer/safer.js (react-thermal-printer.js?v=1bcea9f9:10938:38)
at __require2 (chunk-2TUXWMP5.js?v=1bcea9f9:15:50)
at node_modules/iconv-lite/lib/index.js (react-thermal-printer.js?v=1bcea9f9:14465:19)
at __require2 (chunk-2TUXWMP5.js?v=1bcea9f9:15:50)
at react-thermal-printer.js?v=1bcea9f9:14746:33Understand this errorAI
2chunk-3LN55J2K.js?v=1bcea9f9:5305 Error handled by React Router default ErrorBoundary: TypeError: Cannot read properties of undefined (reading 'prototype')
at node_modules/safer-buffer/safer.js (react-thermal-printer.js?v=1bcea9f9:10938:38)
at __require2 (chunk-2TUXWMP5.js?v=1bcea9f9:15:50)
at node_modules/iconv-lite/lib/index.js (react-thermal-printer.js?v=1bcea9f9:14465:19)
at __require2 (chunk-2TUXWMP5.js?v=1bcea9f9:15:50)
at react-thermal-printer.js?v=1bcea9f9:14746:33

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

1 participant