Why webpack tries to load my .map from my lib - vue.js
I have a Vue application that is currently using a lib.
When I try to compile it gives me this error:
Module parse failed: Unexpected token (1:10)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/models/common.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,QAAQ,UAAW,MAAM,KAAG,MAAM,GAAG,IAQjD,CAAC;AACF,eAAO,MAAM,GAAG,UAAW,MAAM,KAAG,MAAM,GAAG,IACU,CAAC;AAqBxD,eAAO,MAAM,IAAI,UAAW,MAAM,KAAG,MAAM,GAAG,IAI7C,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,MAAM,KAAG,MAAM,GAAG,IACkB,CAAC;AAEjE,eAAO,MAAM,KAAK,UAAW,MAAM,GAAG,MAAM,KAAG,MAAM,GAAG,IAKvD,CAAC;AAEF,eAAO,MAAM,GAAG,UAAW,MAAM,GAAG,MAAM,KAAG,MAAM,GAAG,MAAM,GAAG,IAE9D,CAAC;AAEF,eAAO,MAAM,MAAM,UAAW,MAAM,KAAG,MAAM,GAAG,IAI/C,CAAC;AAEF,eAAO,MAAM,IAAI,UAAW,OAAO,KAAG,OAAO,GAAG,IAE/C,CAAC;AAEF,eAAO,MAAM,KAAK;;2BAGS,MAAM,KAAG,MAAM,GAAG,IAAI;;;;;;2BAStB,MAAM,KAAG,MAAM,GAAG,IAAI;;;;;2BAQtB,MAAM,KAAG,MAAM,GAAG,IAAI;;;;;;2BAStB,MAAM,KAAG,MAAM,GAAG,IAAI;;;CAGhD,CAAC"}
I don't understand what kind of loader it wants and why it tries to compile my source map files from another library. Any help would be useful. Thanks.
Related
Calling *.aar files (android library) in nativescript vue
I already create an .aar (android library) files in android studio and want to call/use it in nativescript-vue project. I have placed the aar file in "app/App_Resources/Android/libs" folder. Based on my reading, in typescript the way to call the method in aar files is by calling com.package.MyClass. My question is , how to call it in .vue files. I have tried to call the method using the same approach but its produce an error : Module not found: Error: Can't resolve com.package.MyClass Can someone please help me on this. Your help is very much appreciated.
You may simply place your AAR file in your App_Resources/Android/libs directory, CLI will pick it up at build time and the native APIs should be available at runtime within your project. Try a clean build if you see errors, make sure the AAR is picked up. You might be able to verify it from the CLI logs. If you still see issues, make sure the class you are trying to access is public.
I'm not sure it's possible to use the android lib directly in the main project or not. In my way, I create a NS plugin that includes the .aar library, then add this plugin to the main project & use the methods defined in the .aar library without problem. If you place the .aar library in the main project, you should check if that .aar library is installed by running tns build command & look at console log. If it's installed together with the project, that means you can use the lib method in .vue or any .js files.
How to load a dll in Karaf container?
I have a dll which provides a simple functionality (called HelloCpp.dll) and I need to access to the content of this library from Karaf container via REST calls. I created a simple maven bundle which provides the REST api and a class (HelloJNI) which loads HelloCpp.dll using: System.loadLibrary("HelloCpp"); I have also addressed this dll in my POM file using: <Bundle-NativeCode>HelloCpp.dll</Bundle-NativeCode> I have coppied the dll in both project directory and also karaf/lib folder. I can successfuly install the bundle and I don't receive any compilation error as well, but when I deploy my bundle into Karaf container and try to start bundle, I get this error message: No matching native libraries found. Could you please help me to solve the problem? Maybe I don't address the dll correctly in the POM file. Thanks in advance, Mandana
Allow Dojo require() to fail
I have a require statement that loads in a layer that I build with Dojo. I want to be able to test my code without having to build my Dojo source every time. However, if I don't build and the require statement is called, it fails with a 404 error. Is there any way to catch this 404 error and allow it to fail?
Any module in an application can be converted into a “layer” module, which consists of the original module + additional dependencies built into the same file. Using layers allows applications to reduce the number of HTTP requests by combining all JavaScript into a single file. Creating a new layer file just for the production version of your application is not the correct way to create a build. Instead, build into a module that you’re already loading in development. Then, your require calls never change between development and production; the only difference is that your layered modules contain their dependencies.
OSGI cannot link to native method via JNI at runtime
I am trying to use a method from a DLL in a OSGI-bundle. The DLL gets loaded correctly in OSGI, but I still get an java unsatisfied link error, the native method is not found! When deployed standalone in Java only (no OSGI), the DLL gets loaded and run perfectly. Here's what I did: I generated a JNI bridge to my C++ compiled DLL through SWIG. I specified the package name when calling swig. I declared the dll inclusion in my Maven pom.xml xml element, which generates a correct Manifest file. Loading of the DLL libraries is done without any errors / warnings What truly puzzles me is that the symbols in the dll seem to not be found: java.lang.UnsatisfiedLinkError: com.bmw.corona.components.sample.impl.generated.AdasDeconstructorJNI.swig_module_init()V The problem is when coupling it with OSGI, I'm guessing somewhere in OSGI's ClassLoader. The method in the dll seems to have a the correct signature : _Java_com_bmw_corona_components_sample_impl_generated_AdasDeconstructorJNI_swig_1module_1init#8 with the following prototype in the generated SWIG file: SWIGEXPORT void JNICALL Java_AdasDeconstructorJNI_swig_1module_1init(JNIEnv *jenv, jclass jcls) I was triple-sure to check that the Manifest includes the Bundle Native instruction. What am I doing wrong?
You may want to consult this wiki article: http://wiki.osgi.org/wiki/Dependencies_In_Native_Code It is hard to tell from your description, but it sound like you have 2 native libs. One with the JNI entry points and the other with the real native function. The above wiki article discusses the dependencies from the JNI native lib to other native libs.
The problem was twofold. First, the methods weren't found do to Visual Studio 2010's method name mangling. I added a linker directive : #pragma comment(linker, "/EXPORT:__Java_com_bmw_corona_components_sample_impl_AdasDeconstructorJNI_swig_module_init=_Java_com_bmw_corona_components_sample_impl_AdasDeconstructorJNI_swig_1module_1init#8") It does take a bit of time for all the bundles (more than 100) to get up and running, and I do get a java.lang.NullPointerException: null the first couple of seconds after launch. Afterwards, everything seems to be working fine. And the nullPointerException is gone..
Play 2 dependency on a local module in Intellij Idea
I am kind of new to PlayFramework 2 and can not figure out how to resolve play 2 application dependencies. I need to add dependency on a local module loaded in IntellijIdea, not a jar file or repository. While adding module dependencies in Idea project setting works just fine and ide itself is able to resolve them (autocompletion, imports etc are working), when trying to run in play2, its compiler cannot resolve any dependencies. I manually configured Build.scala (adding val appDependencies = Seq("" % "" % "")) but am puzzled as to what resolvers I should use. I cannot point to a jar file, as it is a work in progress and such a file should be updated too often. Doing so would defeat the whole purpose of managed dependencies.
Play's main build mechanism uses SBT, which needs to know how to find all sources required for the build. There are several options for this: make your module an SBT project itself and publish it to your local ivy repository. However that might be somewhat complex at this stage, and would involve adding your local ivy repository to the resolvers and re-publishing every time you change something in the module declare your module as a sub-project. Play's documentation describes the process of working with sub-projects, I think this is the way you'd like to try out since then the idea command on Play's console will generate the IntelliJ configuration for the main application and the module.