Webpack compilation, local Module not found: Error: Can't resolve - nativescript

I modified a plugin and added it in my project's file system. So in my package.json I have : "some-module": "file:modules/some-module".
It works fine on my machine (Windows), but not on our build server (Linux CentOS), which fails during webpack compilation with error : Module not found: Error: Can't resolve 'some-module'.
The build server does clean the workspace before build, and after the failed build the plugin does exist in 'node_modules' folder of the workspace.
What could cause this error if the plugin does exists ?
EDIT : I tried on another linux machine (CentOS) and build failed for same error.
EDIT2 : I changed the local file: reference in my package.json file to a .tar.gz git URL. The error is now :
ERROR in ../node_modules/nativescript-pdfview-ng/pdfview-ng.ts
Module build failed (from ../node_modules/#ngtools/webpack/src/index.js):
Error: /root/myProject/node_modules/nativescript-pdfview-ng/pdfview-ng.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format ([link][1]).
at AngularCompilerPlugin.getCompiledFile (/root/myProject/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:719:23)
at plugin.done.then (/root/myProject/node_modules/#ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)

Are you using NativeScript 5.x?
If so, make sure to prefix the plugin with "nativescript-", since {N} 5.x the module resolution seems to have changed with regards to Webpack'ed build.

Related

Error due to "BuildRequires: maven-local" in spec file for Packaging Maven project

Issue : I am following the URL. https://docs.fedoraproject.org/en-US/java-packaging-howto/packaging_maven_project/ to create a spec file for the rpm package.
In the website "BuildRequires: maven-local" is mentioned in the spec file.
but when I tried to search 'maven-local' using yum search maven-local command, I could not find anything and as I was not able to install the component, I'm getting an error when I am trying to do rpmbuild.
Note: I even installed maven separately in my system but it did not help me to fix the issue.

Nativescript testing - tests/example.ts is missing from the TypeScript compilation

I have an Angular flavoured Nativescript project.
After follwoing the steps from https://docs.nativescript.org/tooling/testing/testing I encountered the following error:
ERROR in ./src/tests/example.ts Module build failed (from
../node_modules/#ngtools/webpack/src/index.js): Error:
/home/..../src/tests/example.ts is missing from the TypeScript
compilation. Please make sure it is in your tsconfig via the 'files'
or 'include' property.
The steps I did:
tns test init - enter on jasmine
npm i #types/jasmine --save-dev
started my android emulator
tns run android
You can see that the generated example test file does not work, but I did not read anything on the site about modifying the tsconfig.json.
One possible solution is to ... do exactly as the error message says.
after inserting this:
"include": ["src/tests/**/*.ts"]
to the tsconfig.json (or tsconfig.tns.json), the tests run without a problem.
Although I think this means, this file gets included in every build (not just test runs) so not the best solution yet. Including this line only in the tsconfig.spec.json did not help either, it seems I have to prepare a different build for production which will not include this.

Titanium Android module fails with "does not have a main jar file"

I've created my own new Android Titanium module. The module build was successful and I have the artefact in the dist directory.
I've dropped the zip file inside my project, setup tiapp.xml, cleaned the project, but when running on the device I'm getting the red screen saying
Uncaught Error: Requested module not found: com.myproject.mymodule
I even tried extracting the zip manually and not let Studio do it. I cleaned the project several times.
Why wouldn't it find my module?
EDIT
I now notice a WARN message while compiling the app:
Module com.myproject.mymodule version 1.0.0 does not have a main jar file
I'm doing an ant build from eclipse and everything seems fine. I see the jar file created and present in the module directory inside my project.
Was facing the same error right now and I had a look at the place the error messages appears. It's searching for module.manifest.name.toLowerCase() + '.jar'. So have a look at the modules/android/com.myproject.mymodule/1.0/ folder: the jar file should have the name that is inside the mainifest file (name tag)
The the warning should disappear and the module should be loaded correctly.
You can try doing packaging the module in SDK location or in the particular project and see if things work. What I have always done is packaging the module in SDK location and add it in tiapp.xml of the project I want to use the module without facing any error like this.

Monodevelop source compilation errors

I am trying to download Monodevelop and compile the source code. Following are the errors which I get
{
/home/shankar/Development/Monodevelop/main/Main.sln: error : Could not find the project file '/home/shankar/Development/Monodevelop/main/external/Newtonsoft.Json/Src/Newtonsoft.Json/Newtonsoft.Json.csproj'
/home/shankar/Development/Monodevelop/main/Main.sln: error : Could not find the project file '/home/shankar/Development/Monodevelop/main/external/ikvm/reflect/IKVM.Reflection.csproj'
/home/shankar/Development/Monodevelop/main/Main.sln: error : Could not find the project file '/home/shankar/Development/Monodevelop/main/external/xwt/Xwt/Xwt.csproj'
/home/shankar/Development/Monodevelop/main/Main.sln: error : Could not find the project file '/home/shankar/Development/Monodevelop/main/external/xwt/Xwt.Gtk/Xwt.Gtk.csproj'
}
I see that all the external dependencies are not found. I used "git clone" to clone the project. Is there a specific git option to download the external dependencies or should I download each project individually to compile?
Thanks for your help
Shankar.
http://git-scm.com/book/en/Git-Tools-Submodules
MonoDevelop uses several submodules, you need to also download and check them out.

Trying to compile an XCode project with a workspace on Jenkins slave

I got a Jenkins slave building single xcode projects, working perfectly.
However, I got a project with a workspace where some 3rd party files are setup in the root of the workspace with a gitmodule then imported in to the project as described here.
When Jenkins compiles and reaches AppDelegate.h it throws and error when trying to import a file from the library.
fatal error: 'RestKit/Restkit.h' file not found #import <RestKit/Restkit.h>
I got the project compiling by pointing to the workspace. However it now fails when reaches the packaging stage. I don't see the build directory created in the workspace.
** BUILD SUCCEEDED **
Cannot remove *.ipa files from a non-existing directory:
/Users/leon/Work/projects/wearehive/flatstr/build/Flatstr/dev/jenkins/workspace/Snug-debuOLD/build/Debug-iphoneos
Packaging IPA
FATAL: null
java.lang.NullPointerException
at au.com.rayh.XCodeBuilder.perform(XCodeBuilder.java:421)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:705)
at hudson.model.Build$RunnerImpl.build(Build.java:178)
at hudson.model.Build$RunnerImpl.doRun(Build.java:139)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:475)
at hudson.model.Run.run(Run.java:1434)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Your Project=>build settings=>Header Search Paths, add follow path:
"$(SOURCE_ROOT)/RestKit/Build/Headers"
Be sure checked box in front of them.
I use xcode plugin and use this for SYMROOT value instead of space fixes the problem.
${workspace}/build/[app name]/Build/Products

Resources