Error: Already loaded patch: ZoneAwarePromise - angular5

We try to make server side render build for Angular 5 project, then it shows this error. Zone js is loaded on my polyfills.ts , What the problem how to fix it.
And i observe same Zone code in twice in mys server.js file, thanks
Error: Already loaded patch: ZoneAwarePromise
at E:\ecap3\ecap3-webclient-selectnetwork\dist\server.js:628850:6
at FUNCTION (E:\ecap3\ecap3-webclient-selectnetwork\dist\server.js:628213:10)
at Object.<anonymous> (E:\ecap3\ecap3-webclient-selectnetwork\dist\server.js:628216:2)
at __webpack_require__ (E:\ecap3\ecap3-webclient-selectnetwork\dist\server.js:372510:30)

Related

Cannot use RNFS from react-native-fs

I am receiving this errors after importing RNFS from react-native-fs.
ERROR Invariant Violation: new NativeEventEmitter() requires a non-null argument., js engine: hermes
ERROR Invariant Violation: "ProjectName" has not been registered. This can happen if:
Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes
I installed and tried to import RNFS from react-native-fs for creating files and saving some data in it.

Nuxt.js: Client fails in production, but works during development

I'm using nuxt-edge to serve ssr for an existing rather complicated app. If I run yarn dev everything works great, but after building a production version I get only server-side rendered markup (that also looks as it should) and error on the client
TypeError: [nuxt] Error while mounting app: n.e is not a function
at V (cb1f209f20a02940261c.js:2)
at cb1f209f20a02940261c.js:2
at w (9664f928831af5328a28.js:formatted:4639)
at Generator._invoke (9664f928831af5328a28.js:formatted:4617)
at Generator.t.(anonymous function) [as next] (http://127.0.0.1:3000/_nuxt/9664f928831af5328a28.js:2:83522)
at r (9664f928831af5328a28.js:formatted:4038)
at u (9664f928831af5328a28.js:formatted:4052)
at 9664f928831af5328a28.js:formatted:4057
at new Promise (<anonymous>)
at 9664f928831af5328a28.js:formatted:4049
I have no idea how to debug minified js transpiled by webpack and babel, maybe I'm missing something obvious. Any thoughts are appreciated
So after some digging around I've found out that the problem was in dynamic importing routes by webpack.
Airbnb's babel-plugin-dynamic-import-node fixes the problem.
To allow pass babel config through .babelrc I've used nuxt-babel

React Native: Can't import local files/components

In my react native cli project I am having trouble importing local files.
I just created the project using cli and it was working fine. I ran it in my mobile and it showed the default welcome message. Then I made src folder, components folder in it and created a Header component.
As soon as I imported the header component in App.js and used it it showed this errror message in my packager console.
Bundling `index.js` [development, non-minified] 0.0% (0/317),failed.
error: bundling failed: UnableToResolveError: Unable to resolve module `./src/components/Header` from `/home/sagar/workspace/native/my_expences/App.js`: could not resolve `/home/sagar/workspace/native/my_expences/src/components/Header' as a file nor as a folder
at ModuleResolver._loadAsFileOrDirOrThrow (/home/sagar/workspace/native/my_expences/node_modules/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js:337:11)
at ModuleResolver._resolveFileOrDir (/home/sagar/workspace/native/my_expences/node_modules/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js:222:17)
at ModuleResolver.resolveNodeDependency (/home/sagar/workspace/native/my_expences/node_modules/metro-bundler/src/node-haste/DependencyGraph/ModuleResolution.js:236:19)
at ResolutionRequest.resolveDependency (/home/sagar/workspace/native/my_expences/node_modules/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js:111:14)
at dependencyNames.map.name (/home/sagar/workspace/native/my_expences/node_modules/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js:136:10)
at Array.map (<anonymous>)
at ResolutionRequest.resolveModuleDependencies (/home/sagar/workspace/native/my_expences/node_modules/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js:135:42)
at Promise.resolve.then (/home/sagar/workspace/native/my_expences/node_modules/metro-bundler/src/node-haste/DependencyGraph/ResolutionRequest.js:175:21)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
The error goes away if I remove the Header component and the import statement.
Please help
Edit:
It turns out it is having trouble importing file with jsx extension. I changed the extension to js and the error went away.
So, How can I import jsx files.

Uncaught Error: [vuex] actions should be function but "actions.__esModule" is true

I am new in Vue.js and I want to use vue boilerplate from https://github.com/marcosmoura/vue-boilerplate.
When I try to run this using the command npm run dev it will generate a link, for example, http://localhost:8080.
When I visit this URL in a browser, this error occurs and I am not able to do anything:
Uncaught Error: [vuex] actions should be function but "actions.__esModule" is true
I got same problem and solved it by editing package.json to change the version of vuex to fixed 2.3.0. Maybe something went wrong in version 2.4.0.

Updated react native to v0.6.0 - Error: Invariant Violation: Application TestApp has not been registered.

I'm getting these errors after updating react native to v0.6.0. I even tried creating a project from scratch and I'm still getting these errors. Has anyone else seen this? This code was working before. Any ideas how to fix this?
Error: Cannot read property 'None' of undefined
stack:
index.ios.bundle:24163
require index.ios.bundle:244
index.ios.bundle:23216
require index.ios.bundle:244
index.ios.bundle:1187
require index.ios.bundle:244
index.ios.bundle:1116
require index.ios.bundle:244
Object.ErrorUtils.applyWithGuard index.ios.bundle:880
require index.ios.bundle:195
URL: undefined
line: undefined
message: Cannot read property 'None' of undefinedhandleException # index.ios.bundle:7033
index.ios.bundle:35950 Running application "TestApp" with appParams: {"rootTag":1,"initialProps":{}}. DEV === true, development-level warning are ON, performance optimizations are OFF
index.ios.bundle:7033 Error: Invariant Violation: Application TestApp has not been registered.
stack:
Object.AppRegistry.runApplication index.ios.bundle:35957
jsCall index.ios.bundle:7328
MessageQueueMixin._callFunction index.ios.bundle:7591
index.ios.bundle:7618
index.ios.bundle:7612
ReactDefaultBatchingStrategyTransaction.Mixin.perform index.ios.bundle:6143
Object.ReactDefaultBatchingStrategy.batchedUpdates index.ios.bundle:13907
Object.batchedUpdates index.ios.bundle:4686
URL: undefined
line: undefined
message: Invariant Violation: Application TestApp has not been registered.
I think I figured out the prolblem. It had to do with a component I was using, in my case react-native-device. What I had to do to fix it was delete the node_modules folder located in the component. AppName/node_modules/React-Native-Component/node_modules.
I also updated the dependencies in the package.json file also located in the component folder AppName/node_modules/React-Native-Component/package.json and change the react-native dependency to (or something similar):
"peerDependencies": {
"react-native": ">= 0.4.0 < 1"
},
Update
You can also try restarting the computer. I've noticed with that node starts opening multiple processes and that can cause issues.
Update 2
From the project root folder run in terminal:
./node_modules/react-native/packager/packager.sh --reset-cache
A combination of all the fixes above has fixed it for me. Hope this helps someone.