Url repetition in laravel (inertia and vue) project - laravel-9

I changed a laravel 9 project public dir to separate place:
C:\xampp\htdocs\proj\proj\public to C:\xampp\htdocs\proj\mypbl
But it unexpectedly redicects the url
http://localhost/proj/mypbl/ to http://localhost/proj/mypbl/proj/mypbl/
Has somebody ideas what causes it?

Related

problem laravel in resources js app.js not found

I install websockets,pusher js , echo, and do every thing in the laravel docs
but i have a problem
GET http://127.0.0.1:8000/resources/js/app.js net::ERR_ABORTED 404 (Not Found)
I try to remove file from resources location to public but have the same problem

Debug Vue.js from parent directory

I started out by following microsoft tutoral here which results in one solution and two projects (vue as frontend and api as backend)
Current setup:
Vue 2
.Net 6
It is located at C:/Projects/project_name
Directory layout:
- project_name.sln (solution file)
-- project_nameFrontend (frontend)
-- project_nameBackend (backend)
-- .vscode
The problem is when I open it in C:/Projects/project_name, some of the front end code will show error.
e.g. the following line will result in "couldn't find module #/helpers/interceptors"
import { instance } from '#/helpers/interceptors';
If I open in "C:/Projects/project_name/project_nameFrontend" (where node_module is), no errors.
I know the errors are due to npm, and the parent folder doesn't know where node_module is.
The reason I want to open it in parent directory so I can debug the API backend code as well as the front end at the same time.
Is there a work around for this?

Direct nested URL fails with error "Uncaught SyntaxError: Unexpected token '<'" - Create React App/React-router-dom/Netlify

I've got an app created with create-react-app (with react-router-dom) and deployed with Netlify. Whenever I try and route to a page through a direct (nested) URL, such as 'https://jvcparry.com/products/indie', it fails to load a page and gives the errors
Uncaught SyntaxError: Unexpected token '<' main.e3eaf229.chunk.js:1
However when I navigate the deployed version through links, everything loads fine. I also don't get this error when I'm running the app locally, which I guess means it must be something to do with deployment?
I've trawled through all the other posts I can find with this error, and also things to do with Netlify/CRA deployments. I've got a _redirects file with '/* /index.html 200' in it in my /public folder, and I've tried refactoring my routes to use code-splitting but that's made no difference.
My code is on github here: https://github.com/NatClamp/jvcparry
Deployed version is here: https://jvcparry.com/
and if you go to https://jvcparry.com/products/indie you'll see the error I'm getting.
Can anyone shed any light on this? Thanks in advance
A rigid but working solution is to update _redirects file this way:
/*/main.e3eaf229.chunk.js /main.e3eaf229.chunk.js 200
/* /index.html 200
You can also be updating this file every time you build new js bundle during your CICD run

angular 2 router index.html sharepoint

I have a angular 2 SPA running from within a SharePoint 2010 document library. However, I have a problem with routing. When I start the application by running "index.html", the link in the browser shortly displays:
<server>/scripts/angular_app/index.html
When the application is loaded it changes to:
<server>/scripts/angular_app/#/information-system
'information-system' is the default route of my application.
So far, so good.
If I do a reload of the page now, SharePoint loads its default view:
<server>/scripts/angular_app/Forms/AllItems.aspx
This is because the routing removes the 'Index.html' from the url and SharePoint loads the default which is 'AllItems.aspx' and not 'index.html'.
Is there any way of telling the angular 2 routing system to leave the 'index.html' bit in the url?
Thanks for any help!
Joachim
I added following line to index.html to keep index.html in the URL all the time:
<base href="/index.html">
I solved my issue by extending the base href with the filename at compile time:
ng build --dev --bh /scripts/filingangular/index.html
I was not aware that you could put an actual filename here.

Error after publishing .net web project

I am publishing a project in my local computer, I am getting an error because of the path of the files, in my project I am using relative path, but when i published the project I specified a Site/application so I put: localhost/myapp, but then, after the login the additional name myapp make it loses the path references, do you have any idea how to go through this?
I encountered the same problem with my web application this problem occurs because in your application you are hardcoding paths for ex :- /Home/Index or something which creates problems whenever you want to provide paths use helpers like #Url.Action(),#Html.Action(),#Url.Content() as shown below :-
#Url.Action("Index","Home",new{//specify route parameters here//})
If you are using areas in you application then specify it as :-
#Url.Action("Index","Home",new { area="myarea" })