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

Error Uncaught TypeError: Cannot read properties of undefined (reading 'prototype') #62

Open
matheusbento opened this issue Dec 20, 2023 · 9 comments

Comments

@matheusbento
Copy link

matheusbento commented Dec 20, 2023

Hey Guys, I do not have the printer yet, but I'm trying to test this library, I'm getting the follow error:

image

How can I solve this??

Packages:


"dependencies": {
    "@formatjs/intl-pluralrules": "4.3.3",
    "@formatjs/intl-relativetimeformat": "10.0.1",
    "@fortawesome/fontawesome-free": "6.1.1",
    "@hello-pangea/dnd": "^16.3.0",
    "@hotjar/browser": "^1.0.9",
    "@popperjs/core": "2.11.5",
    "@react-google-maps/api": "^2.19.0",
    "@storybook/react": "^7.3.2",
    "animate.css": "4.1.1",
    "apexcharts": "3.35.0",
    "axios": "0.26.1",
    "bootstrap": "5.2.2",
    "bootstrap-icons": "^1.5.0",
    "bootstrap-switch-button-react": "^1.2.0",
    "chart.js": "3.7.1",
    "clsx": "1.1.1",
    "formik": "2.2.9",
    "glamor": "^2.20.40",
    "i18next": "^23.4.6",
    "i18next-browser-languagedetector": "^7.1.0",
    "js-cookie": "^3.0.5",
    "laravel-echo": "^1.12.1",
    "line-awesome": "1.3.0",
    "lodash": "^4.17.21",
    "moment": "^2.29.4",
    "moment-timezone": "^0.5.43",
    "nouislider": "15.5.1",
    "polished": "^4.2.2",
    "prism-react-renderer": "1.3.1",
    "prism-themes": "1.9.0",
    "prismjs": "1.28.0",
    "pusher-js": "^7.2.0",
    "qs": "6.10.3",
    "react": "18.0.0",
    "react-apexcharts": "1.4.0",
    "react-app-alias": "^2.2.2",
    "react-app-rewired": "^2.2.1",
    "react-beautiful-dnd": "^12.1.0",
    "react-bootstrap": "2.5.0-beta.1",
    "react-copy-to-clipboard": "5.1.0",
    "react-dates": "^21.8.0",
    "react-dom": "18.0.0",
    "react-hook-form": "^7.45.0",
    "react-i18next": "^13.2.1",
    "react-if": "^4.1.5",
    "react-inlinesvg": "3.0.0",
    "react-input-mask": "3.0.0-alpha.2",
    "react-intl": "5.25.0",
    "react-number-format": "^4.9.3",
    "react-qr-code": "^2.0.12",
    "react-query": "3.38.0",
    "react-router-dom": "6.3.0",
    "react-scripts": "5.0.1",
    "react-svg": "^16.1.22",
    "react-table": "^7.7.0",
    "react-thermal-printer": "^0.17.0",
    "react-to-print": "^2.14.13",
    "react-toastify": "^9.1.3",
    "react-topbar-progress-indicator": "4.1.1",
    "sass": "^1.66.1",
    "socicon": "3.0.5",
    "yup": "0.32.11"
  },
  "devDependencies": {
    "@testing-library/jest-dom": "5.16.4",
    "@testing-library/react": "13.1.1",
    "@testing-library/user-event": "13.5.0",
    "@types/bootstrap": "5.1.10",
    "@types/chart.js": "2.9.37",
    "@types/jest": "27.4.1",
    "@types/node": "16.11.27",
    "@types/prismjs": "1.26.0",
    "@types/qs": "6.9.7",
    "@types/react": "18.0.6",
    "@types/react-beautiful-dnd": "^13.1.4",
    "@types/react-copy-to-clipboard": "5.0.2",
    "@types/react-dates": "^21.8.3",
    "@types/react-dom": "18.0.2",
    "@types/react-input-mask": "^3.0.2",
    "@types/react-table": "^7.7.9",
    "@types/sass-loader": "8.0.3",
    "@vitejs/plugin-react": "^4.0.4",
    "@vitejs/plugin-react-refresh": "^1.3.6",
    "css-loader": "6.7.1",
    "del": "6.0.0",
    "mini-css-extract-plugin": "2.6.1",
    "prettier": "2.6.2",
    "rtlcss-webpack-plugin": "4.0.7",
    "sass-loader": "13.0.2",
    "typescript": "4.6.3",
    "vite": "^4.4.9",
    "webpack": "5.74.0",
    "webpack-cli": "4.10.0"
  },
@12-Davance
Copy link

@seokju-na I'm also facing the same issue.

image

@hempun10
Copy link

@12-Davance @matheusbento have you guys find any solutions?

@Felipalds
Copy link

The same error here. Any solution?

@Felipalds
Copy link

I am pretty sure that is something integrating the vite with the library

@hempun10
Copy link

@Felipalds I think so

@Litibe
Copy link

Litibe commented Jun 26, 2024

I have same probleme with Image.

@chamals3n4
Copy link

@Litibe have you find any solution

@Litibe
Copy link

Litibe commented Jun 29, 2024

i work with next.js, i can print with ethernet but it's not possible, same probleme. Also i don't use it :'(

@seokju-na
Copy link
Owner

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.

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

7 participants