I have a Sencha Touch 2 application (non MVC), it works well, except for one JS file. In there I define a store.
In app.json I included sencha-touch.js and this file also. It is building properly, but when I open the page it is saying that
Object has no method 'create'
My app.json:
{
"path": "touch/sencha-touch.js",
"x-bootstrap": true
},
{
"path": "res/mystore.js"
},
{
"path": "bootstrap.js",
"x-bootstrap": true
},
{
"path": "app.js",
"bundle": true, /* Indicates that all class dependencies are concatenated into this file when build */
"update": "delta"
}
I tried many things, but nothing seems to be working, change the sequence, x-bootstrap to true for mystore.js, but nothing. Any idea?
Thanks in advance!
It seems like the problem was the order. After I changed like this:
{
"path": "touch/sencha-touch.js",
"x-bootstrap": true
},
{
"path": "bootstrap.js",
"x-bootstrap": true
},
{
"path": "app.js",
"bundle": true, /* Indicates that all class dependencies are concatenated into this file when build */
"update": "delta"
},
{
"path": "res/mystore.js"
}
it works perfectly.
Related
I've been using Cypress with Cucumber for a while and somehow for some reason, it's stopped logging anything except 'testRunStarted' and 'testRunFinished' to messages.ndjson.
this is my .cypress-cucumber-preprocessorrc.json:
{
"json": {
"enabled": true,
"output": "cypress/cucumber-json/cucumber-json.json",
"formatter": "cucumber-json-formatter"
},
"html": {
"enabled": true,
"output": "cypress/cucumber-html/cucumber-html.html"
},
"messages": {
"enabled": true,
"output": "cypress/messages.ndjson"
},
"nonGlobalStepDefinitions": true,
"stepDefinitions": [
"cypress/e2e/features/*.js",
"cypress/support/step_definitions/**/*.js"
]
}
I have ran cypress with debugging on and confirmed it's picking up the correct config, and it is writing the start and finish to messages, but nothing else.
{"testRunStarted":{"timestamp":{"seconds":1664439067,"nanos":940000000}}}
{"testRunFinished":{"timestamp":{"seconds":1664439137,"nanos":63000000}}}
Absolutely stumped on this one!
I have a question: Where your step definitions are placed? Is it in the same folder where your feature files exists or they are found in support folder? Wherever it present just use that path in your step_definitions in .cypress-cucumber-preprocessorrc.json.
So your .cypress-cucumber-preprocessorrc.json should look like this if your step definitions are in support folder
{
"json": {
"enabled": true,
"output": "cypress/cucumber-json/cucumber-json.json",
"formatter": "cucumber-json-formatter"
},
"html": {
"enabled": true,
"output": "cypress/cucumber-html/cucumber-html.html"
},
"messages": {
"enabled": true,
"output": "cypress/messages.ndjson"
},
"nonGlobalStepDefinitions": true,
"stepDefinitions":
"cypress/support/step_definitions/**/*{.js,.mjs}"
}
Hope you will get your results.
PATH is an environment variable, not your project folder path.
Run the command echo $PATH in order to see a list of paths that are eligible for you to put the cucumber-json-formatter.exe into.
If you don't want to put this file in your path, you can use the json.formatter property in your config to point at this exe file.
Config to point at the formatter:
https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/json-report.md
Where to find the formatter:
https://github.com/cucumber/json-formatter
I have a very peculiar issue, I have a Neutralino app built with Preact that runs perfectly fine when run with neu run, however, once I build the project (with enableServer on or off), the built application will not load anything.
With enableServer on, it will complain that it cannot connect to localhost:
"This localhost page cannot be found"
and with it off it gives me a completely white screen/DOM.
The GitHub repository is here: https://github.com/SpikeHD/XeniaLauncher
I suspect it may be the way I am building the project, but I find it weird that neu run works completely fine.
Below is my configuration:
{
"applicationId": "js.xenia_launcher.app",
"version": "1.0.0",
"defaultMode": "window",
"port": 0,
"documentRoot": "/build/",
"url": "/",
"enableServer": true,
"enableNativeAPI": true,
"tokenSecurity": "one-time",
"logging": {
"enabled": true,
"writeToLogFile": true
},
"nativeAllowList": [
"app.*",
"os.*",
"filesystem.*",
"storage.*",
"window.*",
"debug.log"
],
"modes": {
"window": {
"title": "XeniaLauncher",
"width": 1000,
"height": 800,
"minWidth": 400,
"minHeight": 200,
"fullScreen": false,
"alwaysOnTop": false,
"icon": "/resources/icons/appIcon.png",
"enableInspector": true,
"borderless": false,
"maximize": false,
"hidden": false,
"resizable": true,
"exitProcessOnClose": true
},
"browser": {},
"cloud": {
"url": "/resources/#cloud",
"nativeAllowList": [
"app.*"
]
},
"chrome": {
"width": 1000,
"height": 800,
"args": "--user-agent=\"Neutralinojs chrome mode\""
}
},
"cli": {
"binaryName": "XeniaLauncher",
"resourcesPath": "/resources/",
"extensionsPath": "/extensions/",
"clientLibrary": "/resources/js/neutralino.js",
"binaryVersion": "4.4.0",
"clientVersion": "3.3.0"
}
}
Fixed it! I ended up just setting up some scripts that will put all the built Preact code into the resources folder and re-setup my config to only use the resources folder, like the original Neutralino template. I am sure there could have been a more elegant way, but I am still just learning Neutralino and Preact so this works perfectly well enough for me.
It looks like the resourcesPath needs to be set to the directory where your index.html is found. I have a public dir, and moved the icons over there, then set resourcesPath to /public/ and I was able to neu build --release and run.
I have tested my Azure function to run locally and it works normally but after I deployed, it doesn't trigger whenever I upload a file in the video-temp container.
{
"bindings": [
{
"name": "myBlob",
"type": "blobTrigger",
"direction": "in",
"path": "video-temp/{name}",
"connection": "NewContainer"
}
],
"scriptFile": "../dist/VideoConversionTrigger/index.js"
}
this is my local.settings.json
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node",
"NewContainer": "DefaultEndpointsProtocol=https; ..."
}
}
local.settings.json is only used on local. You need to add settings here after deploy:
And for the error, Microsoft.WindowsAzure.Storage: Requested value 'GET,HEAD,DELETE,MERGE,OPTIONS,POST,PUT,PATCH' was not found., you can break up the values into separate CORS entries.
I already added the following snippet to my package.json:
"build": {
"fileAssociations": [
{
"ext": "asdf",
"name": "ASDF File",
"role": "Editor"
}
]
}
But the generated installer does not assign my application to the asdf extension. (tested on Windows 10)
I also looked up, how to edit the setupEvents.js file. It contains the following part:
case '--squirrel-updated':
// Optionally do things such as:
// - Add your .exe to the PATH
// - Write to the registry for things like file associations and
// explorer context menus
But I could not find a single example, how to archieve the registry writing part.
Add the "perMachine": true, option, e.g.:
"build": {
"fileAssociations": [
{
"ext": "asdf",
"name": "ASDF File",
"role": "Editor",
"perMachine": true
}
]
}
The reason it is needed, is because on Windows, per-user installed program cannot register file associations, and that is the default setting.
It seems that with the newer version you need to set it like this
"build": {
"fileAssociations": [{
"ext": "ext1",
"name": "ext1 File",
"role": "Editor"
},
{
"ext": "ext2",
"name": "ext2File",
"role": "Editor"
}
],
"nsis": {
//othersettings,
"perMachine": true
}
}
there is more information about other file association settings here
I'm trying to setup OpenComponents with custom compiler (based on oc-template-react).
My component's package.json:
{
"name": "hi-there",
"description": "Hello World OC",
"version": "1.0.0",
"oc": {
"files": {
"data": "server.js",
"template": {
"src": "app.js",
"type": "oc-my-template"
}
},
"parameters": {
"name": {
"default": "World",
"description": "Your name",
"example": "Jane Doe",
"mandatory": false,
"type": "string"
}
}
},
"devDependencies": {
"oc-my-template-compiler": "*"
}
}
oc-my-template-compiler is installed. Packaging works fine, but I'm getting following error from registry:
GET http://localhost:3030/hi-there/1.0.0/?__oc_Retry=0
{
code: "TEMPLATE_NOT_SUPPORTED"
error: "oc-my-template is not a supported oc-template"
name: "hi-there"
requestVersion: "1.0.0"
}
I think I should register template with oc.registerTemplate but I'm not sure where should I do it. Should not dev registry take care about it?
If you look into the "oc-client" component (visiting http://localhost:3030/oc-client) you should have a snippet of what is required to correctly render your component with the custom template.
One common thing to do if you are using OC in a dynamic web app, is to server-side render the oc-client component in order to serve the html page with the oc-client already initialised with all the supported templates.