I've made a fresh workspace with the latest sencha cmd 5.0.2.270 and latest ExtJS 5.0.1. Generated an app into in. Wrote a little bit of code.
I generate production build with sencha app build.
The development loads well, but the production build tries to load file with no name and gets a 404
GET http://yassa-built.dev/.js?_dc=1410352524548 404 (Not Found)
After that error it doesn't load at all.
I can't understand what it is searching for. Development is not complaining at all.
I made an archive with it https://mega.co.nz/#!Dk0gDRJD!dNITsq1fGFs5T4d-4yYFnA6_K6EcAhFkxoeEjaJu7MY (~600kb). It includes the sources and the production build.
UPD
I've found the place where it starts to break. In file RadioAdminController.js.
case 'menu_referals':
return app.setSubView('redmed-radioapp-referals', {
store: Ext.create('RedmedAdmin.store.Referals')
});
If I do not create a store - it works. The production build is ok. The store is nothing special:
Ext.define('RedmedAdmin.store.Referals', {
extend: 'Ext.data.Store',
model: 'RedmedAdmin.model.Referal',
autoLoad: false,
autoSync: true
});
On the fourth day of struggling a simple answer revealed.
I've missed one dependency. The chain: RedmedAdmin.store.Referals -> RedmedAdmin.model.Referal -> RedmedAdmin.model.redmed.RadioAppBase.
As I provided the archive, I will list class RedmedAdmin.model.redmed.RadioAppBase here (working version):
Ext.define 'RedmedAdmin.model.redmed.RadioAppBase',
extend: 'Ext.data.Model'
requires: ['Ext.data.identifier.Uuid', 'Ext.data.proxy.Rest']
identifier: 'uuid'
fields: [{
name: 'id'
type: 'string'
}]
schema:
namespace: 'RedmedAdmin.model.redmed.radioapp'
proxy:
type: 'rest'
url: 'http://10.0.29.140:6543/api/rest/{entityName:lowercase}'
reader:
type: 'json'
rootProperty: '{entityName:lowercase}'
listeners:
'exception': (request, operation, eOpts ) ->
Ext.log {level: 'error'}, "Data request to #{request.url} failed. Reply: #{operation.responseText}"
It defines a schema for all children. The schema uses rest proxy (type: 'rest'). It wasn't included in the broken version. Only Ext.data.identifier.Uuid was listed in requires.
Run the app from build/testing/ to see which dependency is missing.
I had the same problem before and the fix was to add required Ext.layout.container.Border' & 'Ext.layout.container.Center'. I had to manually comment out codes & run the production build to check (since it works fine in developement mode). In some cases, it would point out the the missing dependencies like widget/...js
This problem is related to classes need to be added in the requires array. I ran the build using Sencha app build testing then in the debug I cam to know which class was loading empty. To resolve my problem I have added Ext.layout.container.Column but it can be any class, so its better to run the build in testing then identify the problem.
In order to get these configuration properties to work properly, you need to add this 'Ext.data.identifier.Uuid' class as project level.
Include Ext.data.identifier.Uuid as requires in the Ex.Application app.js file
Ext.application({
requires: [
'Ext.data.identifier.Uuid' // Include it
],
models: [
'UsersModel',
'RolesModel',
'LoginModel'
]
.
.
.
.
});
Related
i'm trying to use a plugin in my vuejs project that allows me to create projects in VUE within CMS October, however i updated my node and i believe i updated the webpack version too (from what i've researched) and now my plugin is not working for that error is occurring right on that line of code.
The properties of disableHostCheck and public no longer exist, I would like to know which one I could replace that would have the same effect?
I've been searching the webpack documentation and I couldn't understand which one would be equivalent.
// configure the dev server and public path based on environment
options.devServer = {
disableHostCheck: true,
public: 'http://localhost:8080',
};
ValidationError: Invalid options object. Dev Server has been initialized using an options object that does not match the API schema.
- options has an unknown property 'public'. These properties are valid:
object { allowedHosts?, bonjour?, client?, compress?, devMiddleware?, headers?, historyApiFallback?, host?, hot?, http2?, https?, ipc?, liveReload?, magicHtml?, onAfterSetupMiddleware?, onBeforeSetupMiddleware?, onListening?, open?, port?, proxy?, server?, setupExitSignals?, setupMiddlewares?, static?, watchFiles?, webSocketServer? }
In webpack 5 is changed, please check:
devServer: {
allowedHosts: 'all',
}
I have worked on several web dev projects but have never actually built one from the group up (setting up all the backends was already done by the time I arrived).
Am working on building a site and I need some guidance as the process is incredibly confusing to me.
I want to use WordPress as a headless CMS (so that I can still post and manage the site from WP without editing code) and I was looking to use Gatsby.js.
I have a site on WordPress.com (call it: mysite.wordpress.com). I have created my Gatsby site, run it, nice, and installed the gatsby-source-wordpress package. Finally, I have my config file as follows:
module.exports = {
siteMetadata: {
title: `MySite`,
description: `Testing`,
author: `Me`
},
plugins: [
{
resolve: "gatsby-source-wordpress",
options: {
baseUrl: "mysite.wordpress.com",
protocol: "http",
hostingWPCOM: false,
useACF: true,
verboseOutput: true,
auth: {
htaccess_user: "xxxx#gmail.com", // My actual general WP account email
htaccess_pass: "yyyy", // My actual general WP account pass. I know this is bad practice, I will put this into a dotenv file, I just want to make sure this works
htaccess_sendImmediately: false,
},
},
},
]
}
However, this is not working and I am not sure why. When I run gatsby develop I get the following output:
ERROR #11321 PLUGIN
"gatsby-source-wordpress" threw an error while running the sourceNodes lifecycle:
Cannot convert undefined or null to object
TypeError: Cannot convert undefined or null to object
- Function.keys
- fetch.js:534 getValidRoutes
[emrose]/[gatsby-source-wordpress]/fetch.js:534:26
- fetch.js:148 fetch
[emrose]/[gatsby-source-wordpress]/fetch.js:148:23
- task_queues.js:93 processTicksAndRejections
internal/process/task_queues.js:93:5
- gatsby-node.js:87 async Object.exports.sourceNodes
[emrose]/[gatsby-source-wordpress]/gatsby-node.js:87:18
- api-runner-node.js:235 async runAPI
[emrose]/[gatsby]/dist/utils/api-runner-node.js:235:20
- api-runner-node.js:328 async module.exports
[emrose]/[gatsby]/dist/utils/api-runner-node.js:328:18
- source-nodes.js:86 async module.exports
[emrose]/[gatsby]/dist/utils/source-nodes.js:86:3
- index.js:403 async module.exports
[emrose]/[gatsby]/dist/bootstrap/index.js:403:3
- develop.js:419 async module.exports
[emrose]/[gatsby]/dist/commands/develop.js:419:7
warn The gatsby-source-wordpress plugin has generated no Gatsby nodes. Do you need it?
Despite several hours of googling and youtube'ing, I am not quite clear on how to proceed or if the site I have on my general WP account is even accessible in this format.
I have tried looking for a solution online for quite some time now without success. Keeping in mind that I do intend this site to eventually go live, any guidance on next steps would be awesome (:
While going through the ember 3.6 super-rentals tutorial I ran into a few snags adding the ember-simple-leaflet-maps.
I couldn't get the environment variable LEAFLET_MAPS_API_KEY to set.
https://guides.emberjs.com/release/tutorial/service/
To my understanding, the tutorial has you set an environment variable on your operating system? Maybe I'm wrong in thinking that, but I wanted a way to just add the variable to my project /config/environment.js
Answer from OP:
After the addon was installed:
ember install ember-simple-leaflet-maps
I opened the geocode.js file to see how the service was injecting the api key. Path is:
node_modules\ember-simple-leaflet-maps\addon\services\geocode.js
The line of code was:
let accessToken = getOwner(this).resolveRegistration('config:environment')['ember-simple-leaflet-maps'].apiKey;
From there I just added the lookup it was looking for to my file /config/environment.js
let ENV = {
modulePrefix: 'super-rentals',
environment,
rootURL: '/',
locationType: 'auto',
'ember-simple-leaflet-maps': {
apiKey: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
},
EmberENV: {
FEATURES: {
// Here you can enable experimental features on an ember canary build
// e.g. 'with-controller': true
},
EXTEND_PROTOTYPES: {
// Prevent Ember Data from overriding Date.parse.
Date: false
}
},
APP: {
// Here you can pass flags/options to your application instance
// when it is created
}
};
Rebuild the project and serve, my maps are now showing up
ember build
ember serve
My application is working fine in ext js 4.2.1 but when I upgrade I am unable to get the viewport to load correctly. The view port is in a different file and loads initially but then I get the
Error: [Ext.create] Unrecognized class name / alias: App.view.MainViewport
I have tried requiring the the viewport file but that is not working. Any help would be much appreciated.
app.js
Ext.Loader.setConfig({enabled: true)};
Ext.Loader.setPath('Ext.ux', 'extjs5.1.1/ux');
Ext.require(['Ext.tip.QuickTipManager','Ext.container.Viewport', 'Ext.plugin.Viewport','Ext.layout.*','Ext.form.Panel','Ext.form.Panel', 'Ext.form.Label','Ext.grid.*','Ext.data.*','Ext.tree.*','Ext.selection.*', 'Ext.tab.Panel','Ext.ux.TabCloseMenu'] );
Ext.onReady( function() {
Ext.application({
name : 'App',
appFolder: 'extapp',
launch: function() {
Ext.create('App.view.MainViewport');
}
});
});
MainViewport.js
Ext.define('App.view.MainViewport', {
extend : 'Ext.container.Viewport',
alias : 'widget.MainViewport',
layout: {
type: 'border'
},
initComponent: function() {
console.info("initializing view");
}
});
I did try using the MainViewport in the require but that returned an error and empty page. I actually found the problem and was able to fix it!
The problem was that in the MainViewport file, I had a requires and then the required files also required other files. In order to find the files that were causing the errors, I had to traverse through all of the required files and find the failing one. I did this by commenting out each required file everywhere and eventually found the culprit. Then, my page rendered correctly. Thanks for your help!
In our Dojo system, we have something like the following specified in our dojoConfig:
packages: [{
name: "myWidgets",
location: "/js/libs/widgets"
}]
So that in our require statements, all we have to do is something like:
require(["myWidgets/myCalendarWidget"....
The problem is when I run the build, this dojoConfig is not available and I get numerous missing dependency errors because 'myWidgets' isn't defined according to the build profile.
Now, I've tried adding a package block to the build profile also, but the end result of that is to create an actual 'myWidgets' package, which I don't want.
So, is there any way to make the build see the definition of the 'myWidgets' alias, yet have the end result of the build output still mirror the regular file structure (i.e. /js/libs/widgets)? I tried to define these path aliases in the defaultConfig element in the build profile and that doesn't work either.
If you are using a profile, you can specify the packages in the profile
/util/buildscripts:./build.sh profile=../../../myProfile.js
http://dojotoolkit.org/reference-guide/1.8/build/buildSystem.html#profile-basics
You can also specify a javascript file that holds the dojoConfig
/util/buildscripts:./build.sh --dojoConfig ../build/examples/dojoConfig.js
http://dojotoolkit.org/reference-guide/1.8/build/buildSystem.html#using-a-package-configuration
Answer to your comment. The path is relative from where dojo.js is.
var dojoConfig = {
parseOnLoad: true,
isDebug: true,
locale: 'en-us',
paths: {
"evf": "../../evf"
}
};
My directory structure looks like
js/dojo-1.8.0
dijit
dojo <-- contains dojo.js
dojox
util
js/evf
myCustomWidget.js