Version X: prod build only - Uncaught TypeError: Object(...) is not a function
See original GitHub issueEverything is working fine in dev but when I run a prod build I am seeing Uncaught TypeError: Object(...) is not a function
. I think this is related to the move to preact createContext.
The error starts right after createContext in my build right around hereHt.createContext)(),fn=function(t){function e
.
When I try to log out createContext
it is undefined. I tried using import { Component, createContext } from 'preact';
and import { Component, createContext } from 'preact/compat';
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
TypeError: Object(...) is not a function error only in build version
I get this error only in my build version of project, in production it does not cause any errors TypeError: Object(...) is not...
Read more >How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >JavaScript: Uncaught TypeError: n is not a function
This is a standard JavaScript error when trying to call a function before it is defined. This error occurs if you try to...
Read more >The 10 Most Common JavaScript Issues Developers Face
Uncaught TypeError : undefined is not a function ... With this version, BaseObject inherits the name property from its prototype object, where it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@JoviDeCroock I am also getting the same error for
preact-router: 3.0.1
at/node_modules/preact-router/dist/preact-router.es.js:323:40
My dependency tree is
When I run:
My build starts giving an error in
preact.config.js
which is as follow:With the following error
TypeError: Cannot read property 'filter' of undefined
Any idea what I am doing wrong ?
that fixed it, Thanks!