Remix: Routes starting with "#" like `#username` - remix.run

How do you implement routes in the form of #username so that if I went to my sites /#test route, it would display the route corresponding the to test username?
Currently I have a file under app/routes/#username/index.tsx which uses const { username } = useParams(); but going to that path gives me a 404.

There's currently a bug in the React Router version that Remix uses. It doesn't match routes that start with non-alphanumeric characters.
I believe that's fixed in the latest React Router version. The team is working on porting Remix on top of the new RR 6.4 data features. A lot of Remix features were moved to React Router.
Right now, Remix is pinned to React Router 6.3. I've taken the fix from 6.4 and backported to 6.3 via patch-package. It works fine in dev, but the production bundle is minified. Ugh! I hate it when the minify npm packages. Let the app minifiy during the build!!!
Looks like I'll have to build RR 6.3 with the patch included. Anyway, here's the link to the patch that you can use in dev. I'll try to get to the production version in over the next few days.
https://gist.github.com/kiliman/1a8eb57a6558c96d292bb913add5a178

Related

Undefined route brings list of avalaible routes in production env

I realized my first WebApp with Vaadin 14 and deployed it to Tomcat 9 on the production server.
So far everything is working great, but when I'm using a non-existing route in the client browser the system responds with a plain text list of all available routes and shows even the following line on the bottom:
"This detailed message is only shown when running in development mode."
I have created the WAR-file with "-pProduction" and the startup-log of Tomcat does not show any dev-mode-message.
Any ideas what happens here? Thanks for reading my first question on this platform!
I worked my way through the Vaadin docs and tried the following entry in application.properties:
vaadin.productionMode=true
But nothing changed?
This is a known vulnetability CVE-2021-31413 in Vaadin 14.6.1 and older versions. The resolution is to update the Vaadin version to 14.6.2. The latest version is 14.9.1 as of writing this. Naturally I recommend that.
https://vaadin.com/security/cve-2021-31412

Local url [app_url] not working in Laravel Breeze Vue

So I tried creating a new project using Breeze+vue in Laravel.
I was following this guide: https://www.youtube.com/watch?v=A7UlfXPhsaA
When I finally got vite running on npm run dev without issues, I came across the app_url and I tried to change it to something similar like in that guide (timestamp 6:14 in video), in my case the app_url value was just http://localhost and I changed it to http://grandia.test.
And it reflects like that when vite is running:
VITE v3.1.0 ready in 1031 ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
LARAVEL v9.28.0 plugin v0.6.0
➜ APP_URL: http://grandia.test
but nothing happens when I go to the site. only the localhost:5173 works properly.
I tried googling for answers but I couldn't find anything helpful.
Could someone help me out what I'm doing wrong or missing? Thanks!
I had the same issue, It look like you changed URL: http://grandia.test instead of localhost. So you should try with npm run build instead.
Changing Laravel’s APP_URL parameter will not magically allow you to choose the URL your website is served at. It will only tell Laravel what it should use when generating URLs related to your website.
The video’s author uses the Laravel Valet local development environment. It provides a park command that allows you to automatically serve the subfolders of some folder (e.g. Sites in the video) at http://<subfolder>.test.
In the video, the project is created in Sites/reddit-clone/, which makes it possible to directly access it at reddit-clone.test.

tns preview doesn't work doe to unexpected token

Project successfully prepared (ios)
Start sending initial files for device iPhone.
Successfully sent initial files for device iPhone.
SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at PreviewSdkService. (/usr/local/lib/node_modules/nativescript/lib/services/livesync/playground/preview-sdk-service.js:100:43)
at Generator.next ()
at fulfilled (/usr/local/lib/node_modules/nativescript/lib/services/livesync/playground/preview-sdk-service.js:4:58)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
hey i have exact the same error on same position in preview-sdk-service.js i reinstalled everything with no errors but still the same. i contacted the support, when i get an answer i will let you know. i have also problems with playground today it will not load correctly on my device. btw yesterday it worked like a charm.
---------SUPPORT ANSWER--------------
"we are migrating the auth to use Firebase and looks like couple things are still propagating. An engineer is working on this and should be resolved by Monday"
so its not a user mistake and we can just wait and hope they can fix it quickly.
I'm running into this exact issue at the moment. Even started a new template using the Angular CLI command:
ng new --collection=#nativescript/schematics my-mobile-app
From the site:
Angular CLI support
The initial template seem to work but after adding some custom modules this started happening. Running on a Android Virtual Device works.
I've been looking for a solution and the issues seems to ga back as far as 2018 so i'm not sure if this is even een NativeScript issues of a dev environment issues not being setup correctly.

Heroku not applying environment variable changes in Okta OAuth 2.0 PKCE VueJs app

I' trying to execute the OAuth 2.0 PKCE demo with a VueJs app outlined here:
https://developer.okta.com/blog/2019/08/22/okta-authjs-pkce
https://github.com/oktadeveloper/okta-auth-js-pkce-example
Once in the Heroku App I have these Environment Variables:
Everything appears to be running fine except for the fact that the variables OKTA_CLIENT_ORGURL and OKTA_OAUTH2_ISSUER were refering to an incorrect dev-XXXXXX address, the correct one is the one shown on the picture (dev-371167), before it was someone else's url (dev-739491) for some reason.
The problem is that after making the changes shown in the image to the correct dev url, it's still making the calls to the old dev-739491 url.
Heroku doesn't seem to be refreshing or making the desired changes in the app.
Am I missing an option to refresh? Is it possible to rebuild so it reads the new changes? Could the problem be in the code/build itself?
Thanks.
EDIT: As per the suggestion in the comment I turned the app off then on again and it still didn't make the changes.
This is what my screen looks like:
EDIT 2: I have since deployed the same app two more times and reading the build logs it assigns a random CLIENT_ID and URls. Each deployed app has a different pair of these. I don't know where they come from.
I wrote the Okta Heroku Add-On. I'm looking into the behavior you're seeing.
When you change the environment variables, heroku should restart your app automatically.
So, the two issues are that the environment variables didn't match you saw in Heroku didn't match with what you expected them to be and that the app doesn't seem to be picking up on the environment variables.
How did you know that dev-371167 was the correct org and that dev-739491 was incorrect?
When you say you deployed the app two more times, what exactly are you doing to deploy? Are you using the Heroku cli?

Deploy Laravel to AWS EC2

I already deployed successfully a Laravel and vuejs project to AWS.
I put the project and app.js everything, into ~/laravel then i created a symlink in /var/www/html/laravel/ that point to ~/laravel/public
It is working fine.
I got one problem, whenever i pull a new code including app.js from the branch in github. The code is updated, but when i go to the website, its not updating yet. Several hours later, its back to normal with my new updated code.
Its driving me nut cause i can not test it right away
any suggestion
Thank you
I encountered this behavior when the server was enabled OPcache.
try clear OPcache
https://jenssegers.com/77/clearing-php-s-opcache-with-cachetool
Adding a version number on your app.js every time you compile your assets should fix this. If you are using Laravel mix, simply add on webpack.mix.js file
if (mix.inProduction()) {
mix.version(); // this will add a version number to your app.js
// every time you do `npm run production`
// ex: app.js?id=b35f8fd52c344cb84a52
}

Resources