"Uncaught Reference Error: Polymer is not defined" caused by IP-change? - yeoman

so I didn't touch my current project for almost one month and after that, nothing is running anymore and I get the message
Uncaught Reference Error: Polymer is not defined
for each of my Polymer-Elements and this one once:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/tools/loader/loader.js
Uncaught ReferenceError: PolymerLoader is not defined
I have Polymer included in my main html-file like this:
<script src="bower_components/polymer/polymer.js"></script>
I already deleted and reinstalled all my bower_components, downloaded Polymer directly from GitHub and added the PolymerLoader manually to the referenced directory(deleted it again after it did not work).
I am unsing Version 0.0.20131010 of Polymer (I know it's very old, but it used to work before...) and the newest version of Bower.
I can't find an explanation for all this.
The only thing that has changed is the IP-address of the computer, which I am not refering to anywhere in my code.
I hope you could share some of your thoughts on this with me.

Something is wrong / misconfigured with the HTTP server that's serving these files out. It's not a polymer error if you're getting a 404 for the .js files.
Please ask a new question and include information about the tools that you're using to serve out HTTP.

Related

How do I get SvelteKit and TypeORM to work together?

I know that SvelteKit is still in beta and changing a lot, but I'd still like to ask about getting TypeORM to work with the SvelteKit dev server and production node server.
I made a minimal repository with a basic SvelteKit project (using npm init svelte#next) and TypeORM (using installation instructions here).
When I try to do npm run dev -- I get a warning that import-metadata isn't importing correctly:
reflect-metadata doesn't appear to be written in CJS, but also doesn't appear to be a valid ES module (i.e. it doesn't have "type": "module" or an .mjs extension for the entry point). Please contact the package author to fix.
Then I get an exception from TypeORM:
[vite] Error when evaluating SSR module /src/lib/User.ts:
ColumnTypeUndefinedError: Column type for User#id is not defined and cannot be guessed. Make sure you have turned on an "emitDecoratorMetadata": true option in tsconfig.json. Also make sure you have imported "reflect-metadata" on top of the main entry file in your application (before any entity imported).If you are using JavaScript instead of TypeScript you must explicitly provide a column type.
I'm not sure why the reflect-metadata library doesn't seem to be importing correctly. I've tried both import "reflect-metadata" and import * as Reflect from 'reflect-metadata'; but got the same error. Heck, I even tried copying and pasting the JS library into hooks.ts and commenting out the imports, but the same reflect-metadata and TypeORM errors seem to happen.
Right now my assumption is that if the reflect-metadata library can be imported correctly then that would fix the TypeORM error, but I'm not sure. Here's a relevant issue in the SvelteKit Github and here's a reddit thread I made without much help. I'm hoping that my issue can be solved without opening a new SvelteKit issue but I want to make sure that it's possible to use TypeORM with SvelteKit since it's the most starred JS ORM on Github.
If you have any ideas or solutions I'd love to hear them!

How do I get polyfills to work with Relay?

I have a PHP app and I'm trying to use it with GraphQL and Relay, but trying to get Relay working I keep getting this error in my Browser (Chrome and Safari)
warning.js:36 Warning: Relay relies on polyfills for ES6 features in older browsers. Babel provides a good one: https://babeljs.io/docs/usage/polyfill/
I've tried all sorts of things, and I can't seem to get it to work.
Change webpack configuration, include the polyfill.js as a script.
I can't ignore that warning, because later on I will get:
RelayTaskQueue.js:97 Uncaught TypeError: _promise2.default is not a constructor
I managed to fix the problem myself. The problem was that I was running on Mac OS X with a case insensitive file system.
I tried creating a disk image with case sensitivity, and it worked. Followed instructions here. https://gist.github.com/dixson3/8360571 #

Angular 2 app not loading with Cordova on iOS

I am facing serious problems while developing an Angular 2 app and building it for iOS with Cordova. It kind of works when building and running it for Android (still there are some problems with routes on startup), but I can not get it running on iOS.
The app is developed with Angular 2.0.0-rc.1 and angular-cli.
Whenever I build the app with xcode for iOS, the app is stucked on Angular 2 loading - i guess it is a problem with the bootstrapping process, but I am not sure.
In console, I can see that it fails to load the component css files, like this error shows:
[Error] EXCEPTION: Failed to load file:///var/mobile/Containers/Bundle/Application/F325C057-2287-463A-ABF6-DB68944C63D9/Dooda.app/www/app/notifications/notifications.component.css
logError
logGroup
call
(anonyme Funktion)
invoke (zone.js:323)
onInvoke
invoke (zone.js:322)
run (zone.js:216)
(anonyme Funktion) (zone.js:571)
invokeTask (zone.js:356)
onInvokeTask
invokeTask (zone.js:355)
runTask (zone.js:256)
drainMicroTaskQueue (zone.js:474)
invoke (zone.js:426)
The path is correct, it just can not proceed to load the files. In my iindex.html, I can see that the Container is empty, thus the Angular 2 stuff is not loaded there.
I have set the base href in index as following:
<base href=".">
If you need further information or code, please ask.
Have anyone faced the same issue and can help me here? I am really clueless what to do now, I have no idea why the file loading fails here.
Any help would be highly appreciated!
Thanks in advance!
The solution is very simple, just use
<base href="./">
in index.html file. It will work
had the same problem with Cordova / Ionic on iOS. It was caused by an empty file.
I had a component without template markup, but only with SCSS for the :host-selector.
It seems like Safari doesn't recognize any empty files via XHR and encounters a 404-like error, which breaks the application. To fix that, I removed all empty files from my components. After that it did work for me on iOS-emulator and native iPhone 6.
I am not sure whether it is related with base url for you problem.
In the normal, we will build and package the app with angular-cli into www dir. And after that, you should not see separate css files anymore. Because all css files will be packed in one file, based on your webpack setting.

Nopcommerce nivo slider view not found in production environment

With my visual studio 2012, there is no problem with the binary version of nopcommerce 3.0. But in the production environment, it shows the following error for the home page:
The view
'Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo' or
its master was not found or no view engine supports the searched
locations. The following locations were searched:
~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: The view
'Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo' or
its master was not found or no view engine supports the searched
locations. The following locations were searched:
~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Themes/DefaultClean/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Themes/DefaultClean/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Administration/Views/WidgetsNivoSlider/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.cshtml
~/Administration/Views/Shared/Nop.Plugin.Widgets.NivoSlider.Views.WidgetsNivoSlider.PublicInfo.vbhtml
Source Error:
Line 3: #foreach (var widget in Model) Line 4: { Line 5:
#Html.Action(widget.ActionName, widget.ControllerName,
widget.RouteValues) Line 6: }
Any suggestions please?
I faced the same problem. Even the post is quite old but I think answer can help others. Here is the solution for the problem.
The error comes when we publish the project with precompile option selected. If you publish the project without precompiling, you will not face this issue. Because there are some embedded views which do not work properly when we enable precompiling at the time of publishing.
This looks like an publishing error. It seems you have the views in place and they work correctly on your machine, but on the server it's missing some files that didn't get pushed on your FTP, Web Publish, or other form of deploy you're using.
Try to answer these questions and I'm positive you'll find the culprit:
If you're able to remote desktop to your server can you verify the files exist?
What kind of publishing profile are your using? have you tried publishing locally and verify that the file exist there?
If nopCommerce was added using a nuget package, did you make sure to include the files under source control?
Is this a problem only on your workstation? or do any of your co-workers experience the same thing?

JQuery Mobile. Was working, but now has a bug

I have an app that uses jquery.mobile-1.0a4.1.js. The script has worked every time, but now when I try it there is a 1 in 3 chance that I will get this error:
$.mobile.pageContainer is undefined
[Break On This Error] $.mobile.pageContainer.addClass(className);
I have added the origional version and tried again, but I still get the error (line 2425)
Is there any JQuery Mobile version I get that will be error free? Again this error is in the mobile file, and not my code (jquery.mobile-1.0a4.1.js)
Edit I get the same issue when I use the min version as well jquery.mobile-1.0a4.1.min.js
"1 in 3 chance" to me sounds like you have a race condition based on the download times of your scripts. You may want to look at firing custom events when everything is downloaded and ready to go instead of having a downloaded script immediately executing.
Again this error is in the mobile file, and not my code
The error is being reported in the JQuery mobile code, but it could be caused by an error in your script. Try creating a simple test script that uses JQuery mobile to see if you still get the error.
Make sure you still link to the correct JQuery.js file and that's still up.
It's always best to download a working JQuery script and host it on your own server though. So no changes will ever be made to it.
As for your question if there are other JQuery Mobile versions, I'm sure there are.. But that's what Google will help you with.

Resources