Using optional route parameter in sveltekit results in error - sveltekit

I want to use the optional route parameter feature sveltekit offers but it produces an error.
In my 'routes' folder I created another folder '[[lang]]' but when I want to try it out I get this error:
Error: Invalid param: [lang. Params and matcher names can only have underscores and alphanumeric characters.
I'm pretty new to svelte and sveltekit so any help would be greatly appreciated.

I just tried creating a [[lang]]/home route with the latest SvelteKit and it worked fine.
According to your error, the folder name seems to be detected as [[lang], not [[lang]].
However, when I tried renaming my [[lang]] folder to [[lang] I got a different error: Invalid route /[[lang] — brackets are unbalanced
To help diagnose the actual problem, I suggest creating a github repo with a simple reproduction based on the starter template from npm create svelte#latest

Related

importing Amplify throws error "null is not an object (evaluating 'keys.filter)" in react native app

Any time I import Amplify into my React Native project's App.js file, I get the following error:
TypeError: null is not an object (evaluating 'keys.filter')
Here is how I'm importing it:
I run the project using Expo only. If I comment the import Amplify line out, any other files which use anything related to Amplify cause the same error to occur.
Initially, when I was loading this project for the first time, I had other errors to deal with like first needing to create the aws-exports.js file. I copied this over from an old project (Because this is meant to be a re-do of another project that's already set up). Once I included that file I had to update a few lines in that file because of an improper reference to Linking from expo. Once I fixed that, it throw this error I'm referencing here. Now, even if I delete the aws-exports file it will throw this error as soon as Amplify is imported into the App.js file.
-- Update
I've found where the error is occurring. Some of my code gets executed but the error happens inside of the reactnative.js file when syncing between two memory software.
I've tried to reproduce this error inside a fresh react application by copying the package.js file and then importing Amplify into the App.js file but it doesn't throw this error.
Here is a screenshot of where the error is taking place. I'm still trying to figure out how to pinpoint where in my code this error begins.
According to Expo, you have to follow these steps
it would be best if you imported Amplify
import Amplify from '#aws-amplify/core'
All you need to follow those steps it sees the configuration issue result data is not coming that's why it gives a null value and crashes.
Follow steps below will fix your problem
https://blog.expo.dev/how-to-build-cloud-powered-mobile-apps-with-expo-aws-amplify-2fddc898f9a2
The problem seems to be resolved by changing the slug attribute in the react app.json file. I changed the slug from being a camel case to an all lower case slug.
After this the error has gone away for what seems permanent. I've been able to replicate the error in small sample apps. I don't understand why this causes these errors.

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'?

React cannot use URLs with more than one slash in Route

I'm currently studying React with manual setup (not using Create-react-app).
I used Webpack and Babel.
After installing 'react-router-dom,' I tried to use URLs with more than one slash for the path attribute in element. For example, "/contact/add"
However, it only returns a blank page with 404 error.
(Btw, it works perfectly when I use only one slash)
I looked around other stackoverflow posts and found that it's an issue with a "client-side" problem.
So, is there any method to handle this issue?

Warning: [react-router] Location "/D:/original/22-02-2017/job2.html" did not match any routes

I am working with typescript-with-react. And i m using webpack as a compiler . And my directory structure is as follows:
d:/original/22-02-2017/
-
and my entry point in web.config.js is ./src/index.tsx file.
my components placed inside src/components/demo.tsx
and my index.tsx file is as follows
and inside /job2.html i have following links
but when i am trying to run program it gives me following error
Warning: [react-router] Location "/D:/original/22-02-2017/job2.html" did not match any routes
and i am not using server port i am just running my app at
file:///D:/original/22-02-2017/job2.html
i have tried many but not get succeed. please help me what is wrong with my code?
This one is the very old question for React router. Now we can use React-Router-DOM for routing with react. It is very easy to understand and very simple to use.

Ionic 2 angular-2-in-memory-web-api 404 error

I've been developing a simple app in Ionic 2 and I tried using mock service (in-memory web API) for fetching data as described in this Angular 2 tutorial. My console reported this error:
TypeScript error: app/app.ts(11,49): Error TS2307: Cannot find module
'angular2-in-memory-web-api'.
I tried this solution: angular2-in-memory-web-api 404 error. After running this: npm i angular2-in-memory-web-api --save, I was unable to find the files where I was supposed to use the code provided in the rest of the solution.
How can I fix this? Sorry if the question is not posed quite right, this is my first one. Please ask if any additional information is needed. The problem is pretty much the same as the one for which the solution was provided in the link above, except that using Ionic 2 makes the given solution inapplicable in my case. I'm don't think SystemJS is being used, please see my file structure image.
Image of my file structure.

Resources