English 中文(简体)
是否有办法在下游电线内进行下游工作(现在我正在使用下台,但我可以向任何人开放)?
原标题:Is there a way for next-auth to work inside nextjs electron (I am using Nextron for now but I am open to anything) app?

Is there a way for next-auth to work inside electron js app? Because I heard that API Routes and specially dynamic API Routes don t work with electron app because in nextjs electron uses next export for production build. I have created a project in next-js and using next-auth for authentication with Azure-AD provider (To login with microsoft accounts). The problem is that everything is fine in electron app when on development, but as soon as you create a production build, the dynamic routes don t get called. I tried to search for a solution but there isn t much discussion about this topic on the internet.

I am using nextron at the moment, but I am open to anything if there is any. The only restriction that I have is that the app should be nextjs .

问题回答

是否有办法在电 j内工作?

是的,在使用电线的申请人中至少可以找到一种途径。 js。

转口路线和特别活跃的亚普兰航道不会用电灯进行工作,因为在接下来的几里,电线会利用下一次出口进行生产。

情况并非如此。 您所描述的行为是:Nextrons 建造工程。 Nextron s Buildingtor under the hood used next export in it s nextron-build.ts。 仅出口超文本的“,CSS, 贵国应用代码<>renderer。 UI。 对静态网站或单一页应用(SPAs)有用,但对于要求获得Node.js(或其他)支持的申请人来说,这种支持不是为了服务或操作像Austh.js(next-auth) ——你正在使用的Adth.js(next-auth)-AD auth提供商这样的转机。

注:随着次js v13.3.0+,next export被折旧,此后再不需要再做编辑的申请书。 您可配置<代码>next ,以生成out>/code>的名录,并使用<代码>output: export ,载于next.config.js。 如下:

const nextConfig = {
 output:  export ,
}

module.exports = nextConfig

为了使用电离层的电灯光+信号灯,而不是使用下台(这限制了你对静态出口的应用),你可使用electron-builder。 页: 1 下面是<代码> 包装.json所需改动的最低限度例子:

...
"scripts": {
    "dev": "npm run build && electron .",
    "build-renderer": "next build renderer",
    "build": "npm run build-renderer",
    "dist": "npm run build && electron-builder",
  },

 "devDependencies": {
    ...
    "electron": "^13",
    "electron-builder": "^23.0.3",
  },
 "build": {
    "asar": true,
    "files": [
      "main",
      "renderer/out"
    ]
  }
...

如上所述,就生产建筑而言,你将经营:npm 运行/code>。

如果你想进一步定制你的生产建设,你可以创建<条码>builder.config.js,并更新<条码><>布丁/条码>的标语,载于<条码>。

如果你想从零开始使用模板,你可使用这一最低限度的next.js example。 页: 1 ------------------ YOUR_APP_NAME

请举一个完整的实例,说明您对现行申请的升级情况,见a。 对应电离层电离层+ 紧接二连环灯、动态路线和次Auth(Auth.js)集成





相关问题
How to use one react app into another react app?

I have two react apps, parent app and child app. and child app have an hash router. I have build the child app using npm run build, It creates build folder. That build folder moved into inside the ...

how to get selected value in Ant Design

I want to print the selected value, and below is my option list: const vesselName = [ { value: 0 , label: ALBIDDA , }, { value: 1 , label: ALRUMEILA , }, { value: 2 ,...

How to add a <br> tag in reactjs between two strings?

I am using react. I want to add a line break <br> between strings No results and Please try another search term. . I have tried No results.<br>Please try another search term. but ...

热门标签