Sveltekit unable to build because there is a a <a> reference to a file under a folder - sveltekit

I have an <a href="/resources/ink-archive/"> in a file named resources.svelte.
resources.svelte is directly under routes folder, while resources/ink-archieve/ is under a subfolder routes/resouces/ink-archive.svelte.
This gives me an error when I try to build the project. Anyone knows a solution or why is the problem occurring. Its running locally.
Below is the error:
npm run build
at Object.render (file:///home/client/.svelte-kit/output/server/app.js:93:20) > 500 /resources/ink-archive (linked from /resources) Error: 500 /resources/ink-archive (linked from /resources)

Try move and rename resources.svelte to resources/index.svelte

Related

Next.js: ./node_modules/next/dist/client/dev/amp-dev.js

I have a very serious issue right now trying to use Next js. No matter what version I use, any time I try to run the npm run dev, I get the following error:
error - ./node_modules/next/dist/client/dev/amp-dev.js
Module not found: Can't resolve 'C:\Usersudbasili\Documents\Programming\Acumen Developers\myportfolio\node_modules\next\dist\compiled\regenerator-runtime\runtime.js' in 'C:\Users\udbasili\Documents\Programming\Acumen Developers\myportfolio\node_modules\next\dist\client\dev'
error - Error: Cannot find module 'C:\Users\udbasili\Documents\Programming\Acumen Developers\myportfolio\.next\fallback-build-manifest.json'Require stack:
This is literally right after running the create next app command, so I don't install any additional package. One thing realized though is that this error doesn't occur when I use the public folder on my window PC but when I use the user folder called udbasili I get the above error. I have been using next.js for a long time and this is the first I am seeing this error
I had the same issue
the problem was that my project files was in a folder beginning with "ud". My folder name was "udemy".
Renaming that folder or moving the project outside that folder solved the issue
If you compare the paths, there is a missing '\' :
C:\Users**\\**udbasili\Documents\Programming\Acumen Developers\...
C:\Usersudbasili\Documents\Programming\Acumen Developers\...
A quick solution that I gave to this issue was to create the project on a different path. For example:
C:\dev\myportfolio
Please head over to https://nextjs.org/docs/messages/swc-disabled
By disabling swc in next.config.js it will resolve your issue.
You can disable swc by adding:
experimental: {
forceSwcTransforms: true,
}
It's possible your autoimport included '/dist/client/dev' in the 'next/amp' path.
Does it work if you import { useAmp } from 'next/amp'?

Why can't the Web Browser find these modules, resolve, and compile the page?

In a React project, I am trying to run the app on a live server in the web browser. However when I command CD Ravenous to go to the right file and npm start, the browser gives me the following error:
./src/index.js
Module not found: Can't resolve './App' in '/Users/mauricemarkslag/ravenous/src'
I've checked if the imports have been filled in correctly, and that should be the case now I guess. However the error doesn't seem to be fixed with this code:
Code file
Folder structure
Does anybody know what I might do wrong?
You have a typo, you should use ./app.css instead of ./App.css, and I am assuming that the file that you put in your question is app.js.

edit static files (index.html) from yarn build

I used yarn build to create static files for my react app. Now, I want to edit the index.html file in ./build but whenever I add something it gives me an error Uncaught SyntaxError: Unexpected token '<'. Is there a correct way to edit that file?
In your react project you will see a folder called public. Include your hello.js file in that folder. You will also find an index.html file. Include your script tag as follows.
<script src="%PUBLIC_URL%/hello.js" />

failed to compile React projects

I am busy with a project of React and
When I want run a browser I get this error.
./src/Components/ui/icons.js
Module not found: Can't resolve './src/Resources/images/logos/manchester_city_logo' in 'C:\Users\Daniel\Desktop\mancity\src\Components\ui'
This error occurred during the build time and cannot be dismissed.
I made sure of correct names of folders. Is it a npm webpack?
You are most probably referring to a non-existed media file or using wrong file extension when importing manchester_city_logo (probably in icons.js)
Doublecheck the source path for desired media file in icons.js

Glyphicons and fonts not working with Express server and create-react-app build

I am getting error in the browser console:
Failed to decode downloaded font "localhost:5000/static/media/fontname.##$.woff"
OTS parsing error: invalid version tag
Found few solutions/hacks like adding a homepage:"./" to package.json. But none of them worked.
Any real fix for this ?
Found the fix.
All the fonts and images go to the /static/media inside the build folder. Express needs a proper mapping of these folders to access files in the same.
`app.use('/static/media', express.static(path.join(__dirname, '/client/build/static/media/'), {maxAge: 3600000}));

Resources