I have already created a react app by using create-react-app cli. The application is running fine. I have to use guttenberg editor which is there in wordpress 5.
There is a javascript only version available, in https://github.com/front/gutenberg-js.
The problem is when ever I am trying to domReady, editPost these by using following import statement
import { domReady, editPost } from '#frontkom/gutenberg-js';
My react application is not working,
Below is the exception
gutenberg-js.js:104 Uncaught TypeError: Cannot read property 'createContext' of undefined
at Module.push../node_modules/#frontkom/gutenberg-js/build/js/gutenberg-js.js (gutenberg-js.js:104)
at n (gutenberg-js.js:17)
at Module.push../node_modules/#frontkom/gutenberg-js/build/js/gutenberg-js.js (gutenberg-js.js:45274)
at n (gutenberg-js.js:17)
at push../node_modules/#frontkom/gutenberg-js/build/js/gutenberg-js.js (gutenberg-js.js:51)
at Object../node_modules/#frontkom/gutenberg-js/build/js/gutenberg-js.js (gutenberg-js.js:52)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Module../src/components/PageEditor.js (HomeComponent.js:13)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Module../src/index.js (index.css?f3f6:45)
at __webpack_require__ (bootstrap:781)
at fn (bootstrap:149)
at Object.0 (store.js:12)
at __webpack_require__ (bootstrap:781)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
The expectation is import should work.
Related
Uncaught TypeError: Cannot read properties of undefined (reading 'prototype')
at ./node_modules/follow-redirects/index.js (app.js:28291:56)
at __webpack_require__ (app.js:85516:42)
at ./node_modules/axios/dist/node/axios.cjs (app.js:81734:25)
at __webpack_require__ (app.js:85516:42)
at ./resources/js/bootstrap.js (app.js:1209:16)
at __webpack_require__ (app.js:85516:42)
at ./resources/js/app.js (app.js:1172:1)
at __webpack_require__ (app.js:85516:42)
at app.js:85681:64
at __webpack_require__.O (app.js:85553:23)
I have tried unlinking app.js but many features in my project stopped working.
When I try to build my Angular universal app it displays the below error in a terminal window. I have tried various aspects but nothing looks good till now. Can anyone suggest how can identify the root cause of the below error? Because it's a more generic error and I don't have any idea to look at any specific thing due to this generic error. Any help will be much appreciated as I am trying to resolve this for a long today.
Error: NotYetImplemented
at Object.exports2.nyi (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:97:140065)
at getWebGLContext (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:6:175775)
at isSoftwareRendering (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:6:175991)
at Module.57425 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:6:516353)
at __webpack_require__ (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:8145:971155)
at Object.39093 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1:654211)
at __webpack_require__ (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:8145:971155)
at Object.33366 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1:807688)
at __webpack_require__ (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:8145:971155)
at Object.13754 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1:804775)
at resolvePromise (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1284:4397)
at resolvePromise (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1284:3367)
at D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1284:6112
at _ZoneDelegate2.invokeTask (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1268:11819)
at Object.onInvokeTask (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:4690:3154)
at _ZoneDelegate2.invokeTask (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1268:11709)
at Zone3.runTask (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1268:4295)
at drainMicroTaskQueue (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1268:15594) {
rejection: Error: NotYetImplemented
at Object.exports2.nyi (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:97:140065)
at getWebGLContext (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:6:175775)
at isSoftwareRendering (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:6:175991)
at Module.57425 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:6:516353)
at __webpack_require__ (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:8145:971155)
at Object.39093 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1:654211)
at __webpack_require__ (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:8145:971155)
at Object.33366 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1:807688)
at __webpack_require__ (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:8145:971155)
at Object.13754 (D:\Project\Project\ClientPortal\dist\ClientPortal\server\main.js:1:804775),
promise: ZoneAwarePromise [Promise] {```
you are using a third party library in your app that doesn't support ssr. you have to add this code every where you use this library:
isBrowser = false;
constructor(#Inject(PLATFORM_ID) private platformId){
isBrowser = isPlatformBrowser(this.platformId);
}
in your html file:
<thirdparty *ngIf="isBrowser"></thirdparty>
if you use it in your typescript:
if (this.isBrowser) {
...
}
I'm rather new to React and now trying to fix an error that occurs at runtime due to a new version of prosemirror.model in our artifactory. The new version is 1.18.1, the old version that works was 1.16.1.
Loading the page gives the following error in console:
Uncaught TypeError: prosemirror_model__WEBPACK_IMPORTED_MODULE_0__.Schema is not a constructor
at Module.../../components/src/20-molecules/rte/config/schema.js (schema.js:122:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module.../../components/src/20-molecules/rte/index.js (editor.css?e9c4:45:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module.../../components/src/index.js (index.js:1:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/containers/edit/edit.js (index.scss?46f0:45:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/containers/edit/index.js (edit.js:600:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/App.js (types.js:3:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Module../src/index.js (i18n.js:74:1)
at __webpack_require__ (bootstrap:781:1)
at fn (bootstrap:149:1)
at Object.0 (url.js:251:1)
at __webpack_require__ (bootstrap:781:1)
at checkDeferredModules (bootstrap:45:1)
at Array.webpackJsonpCallback [as push] (bootstrap:32:1)
at main.chunk.js:1:57
Code line that breaks:
export const schema = new Schema({ nodes, marks });
I've tried to find the code to create the Schema instance without constructor, but couldn't identify it. Even the prosemirror guide and code themselves use the constructor to create a Schema object, so I'm quite confused about this.
Anyone an idea how to solve this?
I am just trying to clone this repo: https://github.com/oceanprotocol/react-tutorial
when I run the app I get the following stack trace:
Uncaught TypeError: Cannot convert undefined or null to object
at Function.getPrototypeOf (<anonymous>)
at Object../node_modules/whatwg-url/dist/utils.js (utils.js:48)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object../node_modules/whatwg-url/dist/URL.js (URL.js:4)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object../node_modules/whatwg-url/webidl2js-wrapper.js (webidl2js-wrapper.js:3)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object../node_modules/whatwg-url/index.js (index.js:3)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object../node_modules/#oceanprotocol/squid/dist/node/aquarius/Aquarius.js (Aquarius.ts:1)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object../node_modules/#oceanprotocol/squid/dist/node/ocean/Ocean.js (Ocean.ts:11)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object../node_modules/#oceanprotocol/squid/dist/node/squid.js (squid.ts:4)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Module../src/index.js (asset.js:54)
at __webpack_require__ (bootstrap:784)
at fn (bootstrap:150)
at Object.1 (index.js:126)
at __webpack_require__ (bootstrap:784)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
I am not having much luck on unpacking the root cause of the issue and any help is appreciated!
Looks like the package that this tutorial is using is now deleted. (Squid.js)
And regarding why its giving TypeError because whatwg-url is a dependency pacakge of squid.js and whatwg-url is expecting an Object and its receiving undefined or null. May be squid.js internally calls some external url/api for creating an instance.
Instead of using :
import { Ocean } from '#oceanprotocol/squid'.
Use this :
react-tutorial repo has not been updated to support the V3 version of ocean protocol : https://github.com/oceanprotocol/react-tutorial/issues/14
import { Ocean } from '#oceanprotocol/react'
NPM : npm install #oceanprotocol/react https://www.npmjs.com/package/#oceanprotocol/react
Github Documentation : https://github.com/oceanprotocol/ocean.js
Hope this helps !! Cheers.
I am working on a project and we also have a library project that hold all the common components used across the project. In this library I had to add a component that uses materialUI. When I was trying to export that component I was getting the error :
[!] Error: 'ForwardRef' is not exported by node_modules\react-is\index.js
https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module
node_modules\#material-ui\utils\esm\getDisplayName.js (2:9)
1: import _typeof from "#babel/runtime/helpers/esm/typeof";
2: import { ForwardRef, Memo } from 'react-is'; // Simplified polyfill for IE 11 support
Now I was able to solve this by altering the commonjs function from rollup.config.js like this:
commonjs({
include: "node_modules/**",
namedExports: {
"node_modules/react-is/index.js": ["ForwardRef", "Memo"],
},
}),
This in turn has created another error. When I reinstalled the library on the main project straight from the start I get the error.
Uncaught ReferenceError: _extends is not defined
at exactProp (index.es.js:14590)
at Module.<anonymous> (index.es.js:18939)
at Module../node_modules/bt-react-lib/dist/index.es.js (index.es.js:25529)
at __webpack_require__ (bootstrap:782)
at fn (bootstrap:150)
at Module../src/components/main/Main.js (Dashboard.js:52)
at __webpack_require__ (bootstrap:782)
at fn (bootstrap:150)
at Module../src/App.js (log$:24)
at __webpack_require__ (bootstrap:782)
at fn (bootstrap:150)
at Module../src/index.js (index.css?02e3:45)
at __webpack_require__ (bootstrap:782)
at fn (bootstrap:150)
at Object.1 (objects.js:1)
at __webpack_require__ (bootstrap:782)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
Has to do with materialUI again I suppose. Anyone had this before?
You should probably treat material as a peer dependency, together with react and react dom. Here is an example of a boilerplate that helped me on the same issue.
First modify package.json and move material to "peerDependencies": {... }
then you'll have to install rollup-plugin-peer-deps-external and add it to your rollup file. Now you can undo the named exports and you should be done.