小编Bli*_*tva的帖子

NextJS 快速刷新执行完全重新加载并抛出错误:无法加载脚本:/_next/static/chunks/pages/register.js

我正在尝试导航<Link href="/register">Register</Link>到我的注册页面,但是当我单击它时,我收到一条错误/警告,内容是:

  • NextJS 无法加载我的脚本: 在此输入图像描述

或者

  • 快速重新加载必须执行完全重新加载 在此输入图像描述

在这两种情况下,我在终端中收到相同的消息: 在此输入图像描述

这是我的注册页面组件:

import type { NextPage } from "next/types";
import type { FormEvent } from "react";
import { useRef } from "react";
import { createUser } from "../../helpers/helperFuncs";
import styles from "./styles.module.scss";

const Register: NextPage = (): JSX.Element => {
  const emailInputRef = useRef<HTMLInputElement | null>(null);
  const passwordInputRef = useRef<HTMLInputElement | null>(null);

  const submitHandler = async (event: FormEvent<HTMLFormElement>) => {
    event.preventDefault();
    const enteredEmail = emailInputRef.current?.value ?? "";
    const enteredPassword = passwordInputRef.current?.value ?? …
Run Code Online (Sandbox Code Playgroud)

sass reactjs webpack next.js

3
推荐指数
1
解决办法
1万
查看次数

如何从元组列表创建字典而不覆盖第一个唯一键值?

所以我有一个带有键及其对应值的元组列表.我想让它显示为字典,所以我写道

def tup_to_dict (lst):
    return dict(lst)
Run Code Online (Sandbox Code Playgroud)

现在,如果我的是[("A3", "green"), ("B5", "blue"), ("A3", "yellow")],我的输出将是:

{'B5': 'blue', 'A3': 'yellow'}
Run Code Online (Sandbox Code Playgroud)

我如何检查一个密钥是否已经分配了一个值而不是覆盖它.所以我的输出看起来像这样:

{"A3": "green", "B5": "blue"}
Run Code Online (Sandbox Code Playgroud)

谢谢!

python dictionary tuples list

1
推荐指数
1
解决办法
54
查看次数

标签 统计

dictionary ×1

list ×1

next.js ×1

python ×1

reactjs ×1

sass ×1

tuples ×1

webpack ×1