FullCalendar display on localhost but not on server - javascript

I'm currently building a rails app and I need a calendar to display some events so I decided to use FullCalendar.
The calendar works fine on localhost but when I deploy my app on a server, the calendar won't display anymore! I figured out that I have a Javascript error which is not there on localhost.
TypeError: undefined is not a function (near '...$('#calendar').fullCalendar...')
It seems to be the fullCalendar() which is not find when the page is load.
I have done some research but I didn't find anything. Does anyone ever encountered this issues and know how to fix it?
Thank you!

Did you need to rebuild your assets pipeline using rake assets:clean and rake assets:precompile? Don't know if anyone else has observed this behavior, it may be specific to my installation, but whenever I run a rake assets command I have to check the file permissions in my project directory because one or two will have their values changed from 755 to 600 (assuming linux environment). The errors that result are not very helpful in identifying this!

Related

ChunkLoadError: Loading chunk node_modules_next_dist_client_dev_noop_js failed

I've been following the basics tutorial on the Next.js website and when I got to the Global Styles step, I started getting the following runtime error:
ChunkLoadError: Loading chunk node_modules_next_dist_client_dev_noop_js failed.
(error: http://localhost:3000/_next/static/chunks/fallback/node_modules_next_dist_client_dev_noop_js.js)
Error 1:
Error 2:
I followed all the steps exactly and when I close the error pop-up, the app works fine.
If anyone can provide any guidance on this I'd appreciate it a lot!
Delete the .next folder at the root of your project, relaunch your project, and force-refresh your page (Shift+F5 / Cmd+Shift+R) to remove the cache.
It apparently is a cache issue. After browsing through GH Issues & various blog posts, my conclusion is that nobody knows what the heck is going on with this webpack-related error, probably caused by Next.js's behavior.
I had this error after removing files from the /public folder.
How I fixed it:
Remove your /.next folder.
Launch your project again.
Force refresh in you browser to delete the cache.
In my case i had my next.js build directory with a different name as hosted with firebase cloud functions.
Follow these similar steps
Delete your build (distDir) directory (mine was called nextjs)
Restart the server
Force Refresh the browser
For me, the problem appeared when I added a plugin to tailwind.config.js (using tailwind)
maybe this will help someone locate strange nextjs behavior
In my case, I couldn't find the .next folder to be deleted.
Delete all the contents of the build / folder. This worked for me.
I deleted the .next folder in VSC. The console log generated more errors, so I then restored the folder back to the project. The errors disappeared.

Error [ERR_MODULE_NOT_FOUND]: Cannot find module... during DigitalOcean App Platform deployment

I'm trying to deploy my node js backend to DigitalOcean with their App Platform with Github.
I tried many things but still don't work yet.
I get this error :
I suppose it can ben because of type module from es6 but localy it work perfectly fine...
Every files are in good folders in my repo in Github so I don't understand why I still get this error...
And this error occur with others controllers/models too, changing each deployment...
This is my first true deployment for a customer and I really need help :-)
Thanks !

Assertion Error : App Version has already been registered

Im using ember to develop a project.
Please help me with this error. Im unable to run my project on local. After hitting
ember server the build is successful. But on hitting the http://localhost:4200
Loads empty page with console error.
Uncaught Error: Assertion Failed: The initializer 'App Version' has already been registered
at assert (index.js:172)
at Function.initializer (index.js:420)
at registerInitializers (index.js:27)
at loadInitializers (index.js:68)
at Module.callback (app.js:25)
at Module.exports (loader.js:106)
at requireModule (loader.js:27)
at app-boot.js:3
Unable to understand what to do. Any help regarding this would be appreciated.
I did a code search to see where that initializer might exist and it looks to be part of ember-cli-app-version.
In your place I would remove ember-cli-app-version from your app with npm uninstall --save-dev ember-cli-app-version and then run ember serve again. The purpose of this addon is to make it easy to see your app's version number in the ember inspector, but that's not a big deal so removing it won't break anything and should get you moving forward.
If you want to investigate the issue further try searching your code base (including node_modules) for App Version to see where a duplicate exists.
Running npm install solved the problem.
The actual issue was due to the iCloud sync being active in my Macbook.
Turning iCloud sync off should solve the problem.

Running Jasmine testing on Ubuntu. Page not found

I installed Jasmine-gem on my project without rails usage as my app is php based on Ubuntu. I go to localhost:8888 as said and get page not found in any browsers. Am I missing a basic HTML page like the standalone install or something?.
I know this isn't a full gems issue because compass and other gems function fine.
Can't figure out what I am doing wrong, it is able to find the specs in the command line.
I could just load jasmine standalone but if is possible to get this running, I would really appreciate it!
Thank You.
Forgot to mention I am running Windows. Since Jasmine will run on its own server, I installed it directly on Windows and it works fine. Thanks again for your help. Sometimes you wonder which way you want to go on a shared file system.

rails precompile Why javascript does not work locally but at heroku it works

So, the app was working great locally until I precompiled the assets. When deploying to heroku I did assets precompile and then deployed and it worked fine at heroku, but now it seems javascript got broken.
Any suggestions on how to solve it? Should I delete the files at public folder or use some configuration?
Thanks in advance
UPDATE
I get one of this for each asset file I load in development mode, is it normal?
Started GET "/assets/home.js?body=1" for 127.0.0.1 at 2012-06-15 19:16:48 +0100
Served asset /home.js - 304 Not Modified (0ms)
This is odd. I'm using twitter bootstrap and now to test if javascript is messed up I added a tooltip html example to check if it is also crashed and it actually worked.
But my dropdown at menu bar does not work. How strange is this?
Finally I solved the problem.
Just changed in config/environments/development.rb
config.assets.debug = true
to
config.assets.debug = false
And now javascript works as expected
UPDATE
Now when I have this problem I actually run rake assets:clean and clean the browser cache. This will make your app work as it used to work in development work.
If you want to have a better process, you could instead create a new branch where you run precompile and keep your master branch clean.
Other alternative is to run precompile on heroku so you don't have to do it locally. I haven't tried it yet but there is a 'beta' feature you have to enable so this can work properly in all apps. You can read about it here

Categories