Comments (22)
@SBats . Extremely sorry for the delay. I will update you on it very soon
from ngx-schema-form.
Okay. I'll try to setup a Windows in order to test those issues in the same context as you.
You're still trying to use it on an ionic2 project, right?
And thanks for the head up about quotes on copy-template script :)
from ngx-schema-form.
It should be fixed with 1.0.0-beta.1
from ngx-schema-form.
You are welcome!
We also have to mention @fbessou who is doing great job here!
from ngx-schema-form.
did you use the npm release or the GitHub checkout?
from ngx-schema-form.
#50
As per angular/angular#11262 (comment)
All referenced libraries must include the *.metadata.json file along side any *.d.ts files they produce…
I found an article for the solution - https://medium.com/@isaacplmann/getting-your-angular-2-library-ready-for-aot-90d1347bcad#.np4jova1d
from ngx-schema-form.
I used the npm release package.
from ngx-schema-form.
I have just published 1.0.0-alpha.33, it should be better.
from ngx-schema-form.
I uninstalled angular2-schema form and installed the [email protected] again.
I still get the following error
[00:25:27] ionic-app-scripts 0.0.47
[00:25:27] build prod started ...
[00:25:27] clean started ...
[00:25:27] clean finished in 1 ms
[00:25:27] copy started ...
[00:25:27] ngc started ...
[00:25:29] build prod failed: Unexpected value 'SchemaFormModule' imported by the module 'AppModule'
[00:25:29] ionic-app-script task: "build"
[00:25:29] Error: Unexpected value 'SchemaFormModule' imported by the module 'AppModule'
More Info
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 6.9.2
NPM: 4.0.5
Ionic Framework: 2.0.0-rc.4
Ionic Native: 2.2.11
Ionic App Scripts: 0.0.47
*I still dont see the metadata.json file in the @1.0.0-alpha.33 release
from ngx-schema-form.
@Ragularuban try importing modules from src by import { SchemaFormModule, WidgetRegistry, DefaultWidgetRegistry } from "angular2-schema-form/src" in case metadata file is not there.
It might work.
from ngx-schema-form.
I didn't plan the AOT compatibility at all when I submitted the new structure.
I'm currently working on it in a branch and will do a PR soon.
Sorry for the inconvenience!
from ngx-schema-form.
@alimohammad it still didn't work. the issue was AOT compatibility
@SBats Thanks :-) Much Appreciate it.
from ngx-schema-form.
Hey @alimohammad and @Ragularuban , could you please try with the last commit of this branch and let me know if it's any better?
https://github.com/SBats/angular2-schema-form/tree/fix-aot
If it works I'll PR it, merge and publish for a good npm version
from ngx-schema-form.
@SBats Please assist me...
- git clone -g fix-aot https://github.com/SBats/angular2-schema-form.git
2)npm install
npm install threw an error
[email protected] prepublish C:\Users\User\Desktop\test\angular2-schema-form
export NODE_ENV=production; npm run build'export' is not recognized as an internal or external command,
operable program or batch file.
I think the error is because I'm running in windows. so I continue it doing manually. I edited webpack.config.js to run in production then I continue with
3)npm run build
It threw the below errors
[email protected] copy-template C:\Users\User\Desktop\test\angular2-schema-form
copy ./src/**/*.html ./dist/srcThe syntax of the command is incorrect.
I read npm copy documentation to find out that i need to wrap files names in a quote. so I changed
copy ./src/**/*.html ./dist/src
To
copy "./src/**/*.html" "./dist/src"
and then ran the build...
It threw the below error
[email protected] copy-template C:\Users\User\Desktop\test\angular2-schema-form
copy "./src/**/*.html" "./dist/src"./src/**/*.html
The filename, directory name, or volume label syntax is incorrect.
0 file(s) copied.
I tried various methods, but copy command is not letting me copy anything apart from the root directory(Weird)
Finally, I decided to replace the 'copy' module with 'copyfiles' module
the build then finished without any errors! :-)
I copied the files into my project. When I tried to build the solution I got the below error
[05:41:34] ngc started ...
[05:41:54] typescript: ...cts/*****/node_modules/angular2-schema-form/dist/src/model/formproperty.d.ts, line: 1
Cannot find type definition file for 'core-js'.L1: import { BehaviorSubject
from 'rxjs/BehaviorSubject';
[05:41:54] ionic-app-script task: "build" L2: import 'rxjs/add/observable/combineLatest';[05:41:54] Error: Failed to transpile TypeScript
So I tried looking into the issue and found out that core-js typings are missing, so I copied the node_modules/@typings folder to my project folder and ran my project build
It threw the below error
[05:53:36] ngc started ...
[05:54:00] typescript: ...s/User/Desktop/private_projects/projectXv2/node_modules/@types/core-js/index.d.ts, line: 21
Duplicate identifier 'PropertyKey'.L20: * target object. Returns the target object. L21: * @para[05:54:00] typescript: ...s/User/Desktop/private_projects/projectXv2/node_modules/@types/core-js/index.d.ts, line: 85 m
tar[05:54:00] typescript: ...s/User/Desktop/private_projects/projectXv2/node_modules/@types/core-js/index.d.ts, line: 145 g
et T
e target object to copy to.
L22: * @param source1 The first source object from which to copy properties.All declarations of 'name' must have identical modifiers.
[05:54:00] typescript: ...s/User/Desktop/private_projects/projectXv2/node_modules/@types/core-js/index.d.ts, line: 276 L84:
otherwise.
L85: * @param predicate find calls predicate once for each element of the array, in ascending
L86: * order, until it finds one where predicate returns true. If such an element is found, findSubsequent variable declarations must have the same type. Variable '[Symbol.unscopables]' must be of type '{ copyWithin: boolean; entries: boolean; fill: boolean; find: boolean; findIndex: boolean; keys: ...', but here has type 'any'.
[05:54:00] typescript: ...s/User/Desktop/private_projects/projectXv2/node_modules/@types/core-js/index.d.ts, line: 311 L146:
* Creates an array from an array-like object.All declarations of 'flags' must have identical modifiers. L261: * number. Only finite values of the type number, result in true. L262: [05:54:00] typescript: ...s/User/Desktop/private_projects/projectXv2/node_modules/@types/core-js/index.d.ts, line: 318 * @param number A numeric value.
Please assist me from here onward....
from ngx-schema-form.
Okay, we're coming close I think.
You are right, I didn't plan windows compatibility. I've fixed scripts following what you used to resolve your windows issues, so it should be ok.
As to types of core-js missings, you should just have to install them as dev dependencies and it should work.
So to summarize:
- remove angular2-schema-form from your node_modules and your
package.json
for now. - remove the
@typings
folder you add manualy. On recent build Typescript is able to automaticly fetch typings from node_modules. So if you have one missing, there's 99% chance you don't have it installed. - install schema form via the command
npm i git+https://github.com/SBats/angular2-schema-form.git\#da7ac6dc990813943c717052e26d8f2a9010a644
(it install it directly in you project instead of having to copy files manualy). Add-S
if you want it saved as a dependency - go in
node_modules/angular2-schema-form
and runnpm run build
- add missing types via
npm i -D @types/core-js
With this, you should have a stable base to test if the new version works.
If not let me know and we'll keep searching what's wrong.
Good luck :)
from ngx-schema-form.
I tried to do do
npm i git+https://github.com/SBats/angular2-schema-form.git\#da7ac6dc990813943c717052e26d8f2a9010a64
• It threw the below error...
npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\User\AppData\Roaming\npm-cache_git-remotes_templates --mirror git+https://github.com/SBats/angular2-schema-f
orm.git\ C:\Users\User\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-SBats-angular2-schema-form-git-da7ac6dc990813943c717052e26d8f2a9010a644-6cf526c4
npm ERR! Cloning into bare repository 'C:\Users\User\AppData\Roaming\npm-cache_git-remotes\git-https-github-com-SBats-angular2-schema-form-git-da7ac6dc990813943c717052e26d8f2a9010a644-6cf
526c4'...
npm ERR! fatal: Unable to find remote helper for 'git+https'
• So, I downloaded the "da7ac6dc990813943c717052e26d8f2a9010a64" commit manually to node_modules/angular2-schema-form
• npm install
• npm run build
• cd to my project root
• ionic build android --prod
It threw the initial error again
[01:24:36] ngc started ...
[01:24:40] build prod failed: Unexpected value 'SchemaFormModule' imported by the module 'AppModule'
[01:24:40] ionic-app-script task: "build"
[01:24:40] Error: Unexpected value 'SchemaFormModule' imported by the module 'AppModule'
:-(
from ngx-schema-form.
@SBats in package.json
"copy-template": "copyfiles './src/**/*.html' './dist/src'",
this command is not working properly. I tried
"copy-template": "copyfiles \"./src/**/*.html\" \"./dist\"",
this seems to do the copy action properly (Something to do with single quote and double quote)
from ngx-schema-form.
Yes. Ionic 2.
Ionic Framework: 2.0.0-rc.4
Ionic Native: 2.2.11
Ionic App Scripts: 0.0.47
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 6.9.2
OS Platform: Windows 7
from ngx-schema-form.
At the moment, I can't make it work because of a conflict between core-js and typescript libraries loaded by Ionic 2. We might need to check if core-js is still needed for our module development.
I'm a bit busy at the moment but I will try to work on this.
from ngx-schema-form.
@SBats It surprisingly works now without any issues :-)
All I did was updated my ionic project....
My bad. It Fails with AOT compiler
from ngx-schema-form.
Any updates on this? I'm getting this same error after installing via npm on the angular4 release. I'm also on Windows and I've tried to work through the steps above but I'm still unable to get this working
from ngx-schema-form.
I didn't check it personally, But one of my colleagues reported that AOT compilation is successful.
Thanks a lot team :-) @ebrehault @SBats
from ngx-schema-form.
Related Issues (20)
- Could not resolve dependency - peer @angular/common@"^11.2.6" from [email protected]
- Parent container for all the form actions HOT 3
- [Bug]: Type mismatch with sf-form component input HOT 1
- Regression loading array data with v 2.7.0
- Visible If not working if value is [0] HOT 3
- Add support for Angular 14 HOT 2
- when adding my angular 14.0.6 project > npm install ngx-schema-form --save HOT 4
- "visibleIf" with nothing vs. "oneOf"
- Support for draft 2020-12 array syntax
- are dependent fields in JSON schema supported ? HOT 2
- visibilityIf no longer works when target is multiple Select widget HOT 2
- Type 'string' is not assignable to type 'TSchemaPropertyType | undefined' HOT 1
- Add support for Angular 15 HOT 3
- Compatibility issue with Angular version 8.2 HOT 5
- Large number input fields behaving oddly HOT 2
- Compatibility with angular 16 HOT 3
- ESM imports not working HOT 1
- undefined type "undefined" error for a valid schema HOT 1
- Issue with visibleIf in array items HOT 4
- upgrade to Angular 17 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-schema-form.