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

TypeError: n.__ is not a function when rendering the Component #221

Closed
t-schlarb opened this issue Jan 15, 2024 · 4 comments
Closed

TypeError: n.__ is not a function when rendering the Component #221

t-schlarb opened this issue Jan 15, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@t-schlarb
Copy link

We currently use the @viselect/preact": "^3.0.0 without any issues.
After an upgrade to the latest @viselect/preact": "^3.5.0 Version, we do get the following error during the rendering process of the component:

flushAfterPaintEffects (http://localhost:5173/node_modules/preact/hooks/src/index.js#424)
TypeError: n.__ is not a function

The Error can be reproduced with the following dependencies:

{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"@preact/signals": "^1.2.2",
"@viselect/preact": "^3.5.0",
"chart.js": "^4.4.1",
"dexie": "^3.2.4",
"preact": "^10.19.3",
"preact-iso": "^2.3.2",
"preact-render-to-string": "^6.3.1",
"primeicons": "^6.0.1",
"primereact": "^10.3.1"
},
"devDependencies": {
"@preact/preset-vite": "^2.8.1",
"eslint": "^8.52.0",
"eslint-config-preact": "^1.3.0",
"typescript": "^5.3.3",
"vite": "^5.0.11"
}
}

@t-schlarb t-schlarb added the unconfirmed Problem is not confirmed yet label Jan 15, 2024
@simonwep
Copy link
Owner

This looks like a bug in preact to me? Since the error is not in any file that corresponds to this package?

@t-schlarb
Copy link
Author

Hi Simon,

thank you for your response.
After some further debugging, there seems to be an exception everytime a javascript event is triggered within the SelectionArea. If, for instance, i try to select something within the SelectionArea, the following exception is thrown within the useState- Hook of the SelectionArea Component (Currently using node v18.19.0):

Screenshot 2024-01-17 142128

SelectionArea.tsx:26 Uncaught (in promise) TypeError: Te is not a function or its return value is not iterable
at b.Ke [as constructor] (SelectionArea.tsx:26:15)
at b.O [as render] (index.js:608:14)
at L (index.js:220:14)
at C (children.js:86:3)
at j (index.js:487:4)
at L (index.js:292:19)
at C (children.js:86:3)
at L (index.js:242:4)
at x (component.js:135:3)
at debounceRendering.js:13:7

@simonwep
Copy link
Owner

Can you reproduce that on the demos or create a codesandbox?

@t-schlarb
Copy link
Author

t-schlarb commented Jan 17, 2024

Hi Simon,

I tried to reproduce it with your existing sample in codesandbox. I forked your existing demo, and just changed the version within the package.json (from @viselect/preact": "3.0.0" to @viselect/preact": "^3.5.0":

https://codesandbox.io/p/sandbox/viselect-preact-forked-xvrh2d

I also made another forked project by just changing the package.json to the same dependencies that we are currently using within our project. This package.json has a more recent dependency tree:

https://codesandbox.io/p/sandbox/viselect-preact-forked-5jx6hk

In both samples, the selection event does trigger an exception.

I hope this information helps.

Regards,
Thomas

@simonwep simonwep added bug Something isn't working and removed unconfirmed Problem is not confirmed yet labels Apr 24, 2024
simonwep added a commit that referenced this issue Apr 24, 2024
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