"renderTo" breaks the execution - extjs

I want to render a toolbar on top of page when the application initiates.
Running the following in viewport.js works when ext-all-dev.js is included in the page. but when I use ext-dev.js instead, it throw the exception.Uncaught TypeError: undefined is not a function
Ext.create("Ext.toolbar.Toolbar", {
renderTo: document.body,
defaultType: 'button',
items: [{text: 'foo'}]
});
What is wrong with it? Also running above code in console works with both ext-dev.js and ext-all-dev.js files. The exception stack is:
Uncaught TypeError: undefined is not a function AbstractComponent.js?_dc=1398852700374:170
Ext.define.statics.updateLayout AbstractComponent.js?_dc=1398852700374:170
Ext.define.updateLayout AbstractComponent.js?_dc=1398852700374:3319
Ext.define.afterRender Renderable.js?_dc=1398852701043:195
Base.implement.callParent ext-debug.js:4266
Ext.define.afterRender Component.js?_dc=1398852699982:435
Ext.define.finishRender Renderable.js?_dc=1398852701043:458
Ext.define.render Renderable.js?_dc=1398852701043:784
Ext.define.constructor AbstractComponent.js?_dc=1398852700374:1231
Base.implement.callParent ext-debug.js:4266
Ext.define.constructor Component.js?_dc=1398852699982:377
constructor ext-debug.js:4897
(anonymous function) VM11066:3
Ext.ClassManager.instantiate ext-debug.js:5485
(anonymous function) ext-debug.js:2112
(anonymous function) Viewport.js?_dc=1398852703350:51

Related

Error with URL in NextJS and I can't find the problem

I have an error that appear in both development and production mode, however, this error only crash the website in production.
I have this error returned:
unhandledRejection: TypeError: Only absolute URLs are supported
at getNodeRequestOptions (D:\FIV\nextjs-fiv-4\node_modules\node-fetch\lib\index.js:1305:9)
at D:\FIV\nextjs-fiv-4\node_modules\node-fetch\lib\index.js:1410:19
at new Promise (<anonymous>)
at Function.fetch [as default] (D:\FIV\nextjs-fiv-4\node_modules\node-fetch\lib\index.js:1407:9)
at fetchWithAgent (D:\FIV\nextjs-fiv-4\node_modules\next\dist\server\node-polyfill-fetch.js:38:39)
at _callee$ (D:\FIV\nextjs-fiv-4\node_modules\swell-js\dist\api.js:191:20)
at tryCatch (D:\FIV\nextjs-fiv-4\node_modules\regenerator-runtime\runtime.js:63:40)
at Generator.invoke [as _invoke] (D:\FIV\nextjs-fiv-4\node_modules\regenerator-runtime\runtime.js:294:22)
at Generator.next (D:\FIV\nextjs-fiv-4\node_modules\regenerator-runtime\runtime.js:119:21)
at asyncGeneratorStep (D:\FIV\nextjs-fiv-4\node_modules\swell-js\node_modules\#babel\runtime\helpers\asyncToGenerator.js:3:24)
And I know that this is the element below causing this error, when I remove it, the error disappears. But I do not understand how to correct it, or what's wrong when checking the network tab. In the network tab I see that this is calling http://localhost:3000/null/api/cart instead of https://my-store.swell.store/api/cart which is weird because on other page this URL is called correctly and I use an .env file to set my environment variables.
//Render Stripe Card Element
var customCardElement = swell.payment.createElements({
card: {
elementId: '#card-element', // default: #card-element
options: {
style: {
base: {
fontWeight: 500,
fontSize: "16px"
},
},
},
onChange: event => {
//setDisabled(event.empty);
if(event.error){
//setError(event.error.message);
}
}
}
});
Client side NextJS variables are only available if prefixed with NEXT_PUBLIC_ because well... they're public

require('devtron').install() causes "Uncaught TypeError: Cannot read property 'BrowserWindow' of undefined" in electron app

I am trying to install the devtron's dev tools from within electron apps developer console and when i try to perform the install i am getting the following error :
> require('devtron').install()
Uncaught TypeError: Cannot read property 'BrowserWindow' of undefined
Turns out I had to turn on the enableRemoteModule option for the browser window.
mainWindow = new BrowserWindow({
width: 900,
height: 680,
webPreferences:{
nodeIntegration : true,
enableRemoteModule:true
}
});

Error: Uncaught (in promise): TypeError: PlotlyService_1._plotly.purge is not a function

On leaving the angular component which uses the Plotly library, gives this error.
Probably an error while destroying the component and Plotly trying to access the purge function
ERROR Error: Uncaught (in promise): TypeError: PlotlyService_1._plotly.purge is not a function
TypeError: PlotlyService_1._plotly.purge is not a function
at Function.remove (http://localhost:4200/vendor.js:191063:37)
at PlotComponent.ngOnDestroy (http://localhost:4200/vendor.js:191206:23)
at callProviderLifecycles (http://localhost:4200/vendor.js:88385:18)
at callElementProvidersLifecycles (http://localhost:4200/vendor.js:88344:13)
at callLifecycleHooksChildrenFirst (http://localhost:4200/vendor.js:88326:29)
at destroyView (http://localhost:4200/vendor.js:98754:5)
at callViewAction (http://localhost:4200/vendor.js:98913:13)
at execComponentViewsAction (http://localhost:4200/vendor.js:98821:13)
at destroyView (http://localhost:4200/vendor.js:98753:5)
I have tried many ways for this issue but finally found the reason.
The plotly-plot was used in 2 modules. The import was done via plotlyViaCDNModule, which was causing the issue.
Use this instead:
import { PlotlyModule } from 'angular-plotly.js';
import * as PlotlyJS from 'plotly.js/dist/plotly.js';
PlotlyModule.plotlyjs = PlotlyJS;
imports: [ ....
PlotlyModule,
]

ExtJSv7: Error while implementing Ext.mixin.Observable

We are trying to implement Ext.mixin.Observable in our ViewController, snippet below
mixins: ['Ext.mixin.Observable'],
constructor: function(config){
this.mixins.observable.constructor.call(this, config);
},
but this raises an error for this.mixins.observable.constructor.call(this, config); in Viewcontroller
BaseController.js?_dc=1587282588103:440 Uncaught TypeError: Cannot read property 'listen' of undefined
at constructor.listen (BaseController.js?_dc=1587282588103:440)
at constructor.callParent (Base.js?_dc=1587282588090:1479)
at constructor.listen (ViewController.js?_dc=1587282588091:206)
at constructor.updateListen (BaseController.js?_dc=1587282588103:257)
at constructor.setter [as setListen] (Config.js?_dc=1587282588102:329)
at Ext.Configurator.configure (Configurator.js?_dc=1587282588102:674)
at constructor.initConfig (Base.js?_dc=1587282588090:1650)
at constructor (Observable.js?_dc=1587282588091:437)
at constructor (MainController.js?_dc=1587282588090:6)
what could be wrong here, I followed the documentation given on sencha docs for Ext.mixin.Observable
Look like you miss this.callParent(arguments) in constructor after call observable constructor

Uncaught TypeError: sweetalert2_react_content_1.default is not a function

I have a react module where i am using TypeScript.
I want to use html within a Swal-component, and that just doesn't work.
Here is my code:
import Swal from "sweetalert2";
import withReactContent from "sweetalert2-react-content";
const MySwal = withReactContent(Swal);
MySwal.fire(<p>Holahola</p>);
When i hover the "Holahola" i get the error message: "Type 'Element' has no properties in common with type 'SweetAlertOptions'.ts(2769)".
When i try to run my code in Chrome, i get: "Uncaught TypeError: sweetalert2_react_content_1.default is not a function"
Someone got a clue what happens here?
I have also tried:
MySwal.fire({
title: <p>Holahola</p>
})
Then i get this error:
That's the known issue, you can subscribe to it here: https://github.com/sweetalert2/sweetalert2-react-content/issues/102
As a workaround, use SweetAlertOptions for passing the params:
MySwal.fire({
title: <p>Holahola</p>
});

Resources