Cakephp 3 manuall plugin error - plugins

I installed a plugin manually and I see an error in my URL address:
http://localhost/cake3/contact-manager/contacts
Error: ContactManager.ContactsController could not be found.
Error: Create the class ContactsController below in file: D:\www\cake3\plugins\ContactManager\src\Controller\ContactsController.php
<?php
namespace ContactManager\Controller;
use ContactManager\Controller\AppController;
class ContactsController extends AppController
{
}
My document:
http://book.cakephp.org/3.0/en/plugins.htm
In config: 'composer.json' to add this line:
"autoload": {
"psr-4": {
"App\\": "src",
"ContactManager\\": "./plugins/ContactManager/src",
}
},
And in file: 'config\bootstrap.php' added this line:
Plugin::load('ContactManager', ['routes' => true]);

Related

ReferenceError: Cannot access 'getRenderingRef' before initialization at stencilSubscription$1

I'm using stenciljs to build my project via prerendering. However, the hydration happens below error.
package.json
"build": "stencil build --prerender --config stencil.config.ts",
output
[ ERROR ] Hydrate Error
ReferenceError: Cannot access 'getRenderingRef' before initialization at stencilSubscription$1
(C:\Users\aleung\Desktop\project\dist\hydrate\index.js:4996:5) at createStore$2
(C:\Users\aleung\Desktop\project\dist\hydrate\index.js:5138:13) at createRouter
(C:\Users\aleung\Desktop\project\dist\hydrate\index.js:5148:42) at hydrateAppClosure
(C:\Users\aleung\Desktop\project\dist\hydrate\index.js:5529:1) at hydrateFactory
(C:\Users\aleung\Desktop\project\dist\hydrate\index.js:34029:3) at render
(C:\Users\aleung\Desktop\project\dist\hydrate\index.js:34296:9) at
C:\Users\aleung\Desktop\project\dist\hydrate\index.js:34228:62 at new Promise (<anonymous>) at
Object.hydrateDocument (C:\Users\aleung\Desktop\project\dist\hydrate\index.js:34220:33) at prerenderWorker
(C:\Users\aleung\Desktop\project\node_modules\#stencil\core\compiler\stencil.js:9988:46)
stencil.config.ts
import { Config } from '#stencil/core';
import nodePolyfills from 'rollup-plugin-node-polyfills';
export const config: Config = {
namespace: 'project',
globalStyle: 'src/global/app.css',
globalScript: 'src/global/app.ts',
taskQueue: 'async',
outputTargets: [
{
type: 'www',
// comment the following line to disable service workers in production
serviceWorker: null,
baseUrl: 'https://myapp.local/',
},
],
plugins: [],
rollupPlugins: {
after: [nodePolyfills()],
},
devServer: {
reloadStrategy: 'pageReload',
openBrowser: false,
},
};
I expect the hydrate can be generated.
According to the docs, your output target needs a prerenderConfig property:
outputTargets: [
{
type: 'www',
// comment the following line to disable service workers in production
serviceWorker: null,
baseUrl: 'https://myapp.local/',
prerenderConfig: './prerender.config.ts'
},
],
And that file needs to export a PrerenderConfig not Config:
import { PrerenderConfig } from '#stencil/core';
export const config: PrerenderConfig = {
...
};
See https://stenciljs.com/docs/prerender-config

This class of the AppComponent is deprecated, please use "sap.fe.core.AppComponent" instead

Did anyone of you come across this error:
"This class of the AppComponent is deprecated, please use "sap.fe.core.AppComponent" instead"
I am trying to create a Fiori application with the following:
Index.html file:
<script>
window["sap-ushell-config"] = {
defaultRenderer: "fiori2",
applications: {
"browse-books": {
title: "Browse PFG requests",
description: "... testing FE v42",
additionalInformation: "SAPUI5.Component=pfgPortal",
applicationType : "URL",
url: "/pfgAdmin/webapp",
navigationMode: "embedded"
}
}
};
</script>
Component.js code:
sap.ui.define(["sap/fe/AppComponent"], ac => ac.extend("pfgPortal.Component", {
metadata:{ manifest:'json' }
}))
Can anyone help me with, where an I possibly going wrong?

Meteor config import .md files

I'm base on Meteor + Vue. Try to import .md files to render to vue template
<template>
..........
</template>
<script>
import mdFile from './README.md'
export default {
name: 'VueMarkdown',
data() {
return {
fileContent: '',
}
},
mounted() {
this.getMDFile()
},
methods: {
getMDFile() {
this.fileContent = mdFile
},
},
}
</script>
but it's got error
[Vue warn]: Failed to resolve async component: function () {
return module.dynamicImport('./Vue-Markdown.vue');
}
Reason: Error: Cannot find module './README.md'
Structure (meteor structure) :
Structure (Meteor structure) :
cleint/
.........
server/
..........
import/
module/
client/
pages/
vue-markdown.vue
README.md
..........
server/
...........
........
I don't know how to config it , can you help me?

Webpack 2 resolve alias

I have a little problem regarding resolving aliases in webpack 2. No matter what i do i cant resolve this. Here is the relevant code:
/* webpack.mix.js */
mix.webpackConfig({
module: {
rules: [
{
test: /\.js$/,
loader: 'eslint-loader'
}
]
},
resolve: {
root: path.resolve(__dirname),
// path is reqired at the beggining of file
alias: {
config: 'src/assets/js/config', // this is a config folder
js: 'src/assets/js'
}
}
});
/* router.js */
import { DashboardRoute } from 'config/route-components'
// this import is unresolved
The resolve.root option no longer exists in webpack 2. Instead it is merged into resolve.modules (from the official Migration Guide). Webpack even throws an error that it's not a valid property. If you want to be able to import from your root directory you would change the resolve config to:
resolve: {
alias: {
config: 'src/assets/js/config',
js: 'src/assets/js'
},
modules: [
path.resolve(__dirname),
'node_modules'
]
}
Alternatively you can use an absolute path in your resolve.alias like so:
resolve: {
alias: {
config: path.resolve(__dirname, 'src/assets/js/config'),
js: path.resolve(__dirname, 'src/assets/js')
}
}
Try this:
resolve: {
root: [
'node_modules',
path.resolve('src') // Resolve on root first
],
alias: {
config: 'src/assets/js/config', // this is a config folder
js: 'src/assets/js'
}
}
In ionic 3 (version 3.13.3), in order to get alias mapping working, you will have to define path mapping both in webpack.config.js & tsconfig.json
Please refer complete answer here question here

Angular2 CLI Socket.io (3rd Party Library import)

angular-cli: 0.0.39
node: 6.2.2
os: win32 x64
I tried to import socket.io-client into an angular2 app generated with the angular-cli but i can't get it to work.
chat.component.ts
import * as io from "socket.io-client";
#Component({
...
})
export class ChatAppComponent {
...
}
system-config.ts
/** Map relative paths to URLs. */
const map: any = {
"socket.io-client": "vendor/socket.io-client/socket.io.js"
};
/** User packages configuration. */
const packages: any = {
"socket.io-client": {"defaultExtension": "js"}
};
angular-cli-build.js
var Angular2App = require('angular-cli/lib/broccoli/angular2-app');
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
'systemjs/dist/system-polyfills.js',
'systemjs/dist/system.src.js',
'zone.js/dist/*.js',
'es6-shim/es6-shim.js',
'reflect-metadata/*.js',
'rxjs/**/*.js',
'#angular/**/*.js',
'socket.io-client/socket.io.js'
]
});
};
package.json
{
"dependencies": {
...
"socket.io-client": "^1.4.8",
"systemjs": "0.19.26"
},
"devDependencies": {
...
"typescript": "^1.8.10",
"typings": "
}
}
typings.json
{
"ambientDevDependencies": {
"angular-protractor": "registry:dt/angular-protractor#1.5.0+20160425143459",
"jasmine": "registry:dt/jasmine#2.2.0+20160412134438",
"selenium-webdriver": "registry:dt/selenium-webdriver#2.44.0+20160317120654"
},
"ambientDependencies": {
"es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
},
"globalDependencies": {
"socket.io-client": "registry:dt/socket.io-client#1.4.4+20160317120654"
}
}
Error and stacktrace
Error: Typescript found the following errors:
C:/Users/Christian/Desktop/prototypes/chat-client/tmp/broccoli_type_script_compiler-input_base_path-5WNagLgm.tmp/0/src/app/chat.component.ts (4, 21): Cannot find module 'socket.io-client'.
at BroccoliTypeScriptCompiler._doIncrementalBuild (C:\Users\Christian\Desktop\prototypes\chat-client\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:115:19)
at BroccoliTypeScriptCompiler.build (C:\Users\Christian\Desktop\prototypes\chat-client\node_modules\angular-cli\lib\broccoli\broccoli-typescript.js:43:10)
at C:\Users\Christian\Desktop\prototypes\chat-client\node_modules\angular-cli\node_modules\broccoli-caching-writer\index.js:152:21
at lib$rsvp$$internal$$tryCatch (C:\Users\Christian\Desktop\prototypes\chat-client\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1036:16)
at lib$rsvp$$internal$$invokeCallback (C:\Users\Christian\Desktop\prototypes\chat-client\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1048:17)
at lib$rsvp$$internal$$publish (C:\Users\Christian\Desktop\prototypes\chat-client\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1019:11)
at lib$rsvp$asap$$flush (C:\Users\Christian\Desktop\prototypes\chat-client\node_modules\angular-cli\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1198:9)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
1) Install socket.io-client
npm install socket.io-client --save
2) Install socket.io-client typings
npm install #types/socket.io-client --save-dev
3) Import socket.io-client in your app/code
import * as io from "socket.io-client";
Is this file present node_modules/socket.io-client/socket.io.js.
Check dts file is present in typings folder for socket-io.
Since you already specified the extension in map no need to specify it again in defaultExtension of package.
Try adding format: 'cjs' OR format: 'amd' based on library in the package -> socket.io-client
system-config.ts
/** Map relative paths to URLs. */
const map: any = {
"socket.io-client": "vendor/socket.io-client/"
};
/** User packages configuration. */
const packages: any = {
"socket.io-client": {
format: 'cjs',
defaultExtension: 'js',
main: 'socket.io.js'
}
};
angular-cli-build.js
module.exports = function(defaults) {
return new Angular2App(defaults, {
vendorNpmFiles: [
'socket.io*/**/*.js'
]
});
};
Working like a charm angular-cli: "1.0.0-beta.10"
This works for me:
npm install --save #types/socket.io-client