Giter VIP home page Giter VIP logo

Comments (14)

saadfrhan avatar saadfrhan commented on May 24, 2024 1

I followed the steps and pushed the changes to the repo. It's showing the same behavior.

image

from integrationos.

saadfrhan avatar saadfrhan commented on May 24, 2024 1

image

from integrationos.

saadfrhan avatar saadfrhan commented on May 24, 2024 1

It worked on the window but its throwing errors on the terminal:
image

EDIT: Changes are pushed to GitHub. https://github.com/saadfrhan/integrationos-demo

from integrationos.

moekatib avatar moekatib commented on May 24, 2024 1

This could be due to the binary requirements when bundling in different OS. Our team will look into this and will get back to you early next week.

Again, thank you very much for sharing this with us and providing these helpful comments.

from integrationos.

moekatib avatar moekatib commented on May 24, 2024 1

We've confirmed an issue with the NAPI Rust package used in AuthKit across certain OS versions. Our team is rewriting the package in native TypeScript and will release an update in the coming days.

from integrationos.

moekatib avatar moekatib commented on May 24, 2024 1

These errors can be fully ignored, they have no impact on the application. As for the CORS, you will need to set the route in 'page.tsx' to the correspondent Vercel server url.

Please let me know if it does not work.

from integrationos.

moekatib avatar moekatib commented on May 24, 2024

Hello @saadfrhan,

Thanks for bringing this up! It looks like Webpack is trying to process a .node binary file and isn't set up to handle it right now. You can fix this by adding node-loader to your project:

  1. Install node-loader:

    npm install --save-dev node-loader
  2. Add this to your next.config.js:

    const nextConfig = {
      webpack: (config, { isServer }) => {
        if (!isServer) {
          config.module.rules.push({
            test: /\.node$/,
            loader: 'node-loader',
          });
        }
        return config;
      },
    }
    
    module.exports = nextConfig

Restart your server after these changes, and you should be all set. Let me know how it goes!

Cheers!

from integrationos.

moekatib avatar moekatib commented on May 24, 2024

Can you please give me some info about your OS. It looks like a build issue.

from integrationos.

moekatib avatar moekatib commented on May 24, 2024

Turns out, handling node binaries in Next.js needs a bit of special attention.

Our team managed to sort it out with these steps:

  1. Run npm install nextjs-node-loader --force (force flag is needed due to some eslint incompatibilities, but it's all good, nothing to worry about).
  2. Update next.config.js with the custom loader setup for .node files.

Here's the snippet for our next.config.js that did the trick:

/** @type {import('next').NextConfig} */
const nextConfig = {
  webpack: (config, { dev, isServer, webpack, nextRuntime }) => {
    config.module.rules.push({
      test: /\.node$/,
      use: [
        {
          loader: "nextjs-node-loader",
        },
      ],
    });

    return config;
  }
};
export default nextConfig;

Should work after this. If you bump into any more quirks, let me know!

from integrationos.

saadfrhan avatar saadfrhan commented on May 24, 2024

Thanks! It worked. 🙌😊

from integrationos.

moekatib avatar moekatib commented on May 24, 2024

Are you by any chance trying to bundle the application for a different OS? Also, does the UI show with the activated integrations?

from integrationos.

saadfrhan avatar saadfrhan commented on May 24, 2024

When I deployed it to Vercel, it threw errors the same as in the screenshot and an error which says that it felt the corsHeaders as a route name.

image

So when I removed the export from corsHeaders, it deployed it but it threw CORS error on the console.

from integrationos.

moekatib avatar moekatib commented on May 24, 2024

Our team has identified the cause of the issue. It seems the warning from Next.js' build system can be ignored. It appears that Next.js tries to cache every package, even those that are dynamically loaded, likely to speed up builds.

To fix your code for deployment on Vercel, remove the export from export const corsHeaders in your route.ts.

I am going to close this issue, put feel free to reopen if you still have any issues.

from integrationos.

saadfrhan avatar saadfrhan commented on May 24, 2024

I removed the export from the corsHeaders. (new code pushed to repo)

It ran successfully, but the terminal is showing same errors:
image

Vercel deployment is also showing same errors:
image

and I am getting cors error on production:
image

from integrationos.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.