Coder Social home page Coder Social logo

Comments (3)

gkawin avatar gkawin commented on September 26, 2024

Dear Omise team, any update for this PR to fix the #141 issue? This PR could save anybody using NextJS and deploy to the Vercel Hosting.

from omise-node.

cpvdeveloper avatar cpvdeveloper commented on September 26, 2024

I just tried this out again by deploying a minimal Next.js app to Vercel. Using this library in an API route causes the route to crash with a 500 error (see below). So just an FYI, this library still doesn't seem to work with Next.js deployed on Vercel.

Should be fixed by #166, although I only tested this fix a long time ago so cannot be 100% sure (given that Next.js versions have increased a lot since then).

2022-11-17T01:19:18.593Z	e7387498-a0d1-4a63-a775-f05eefa8ea88	ERROR	Error: Cannot find module './resources/Source'
Require stack:
- /var/task/node_modules/omise/lib/apiResources.js
- /var/task/node_modules/omise/index.js
- /var/task/.next/server/pages/api/hello.js
- /var/task/node_modules/next/dist/server/next-server.js
- /var/task/___next_launcher.cjs
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.mod._resolveFilename (/var/task/node_modules/next/dist/build/webpack/require-hook.js:23:32)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at resourceName (/var/task/node_modules/omise/lib/apiResources.js:7:10)
    at Object.module.exports.omiseResources (/var/task/node_modules/omise/lib/apiResources.js:40:14)
    at module.exports (/var/task/node_modules/omise/index.js:5:19)
    at handler (/var/task/.next/server/pages/api/hello.js:26:46)
    at Object.apiResolver (/var/task/node_modules/next/dist/server/api-utils/node.js:367:15)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async NextNodeServer.runApi (/var/task/node_modules/next/dist/server/next-server.js:474:9)
    at async Object.fn (/var/task/node_modules/next/dist/server/next-server.js:736:37)
    at async Router.execute (/var/task/node_modules/next/dist/server/router.js:252:36)
    at async NextNodeServer.run (/var/task/node_modules/next/dist/server/base-server.js:384:29)
    at async NextNodeServer.handleRequest (/var/task/node_modules/next/dist/server/base-server.js:322:20) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/var/task/node_modules/omise/lib/apiResources.js',
    '/var/task/node_modules/omise/index.js',
    '/var/task/.next/server/pages/api/hello.js',
    '/var/task/node_modules/next/dist/server/next-server.js',
    '/var/task/___next_launcher.cjs'
  ]
}

from omise-node.

aashishgurung avatar aashishgurung commented on September 26, 2024

Fixed by #190.

from omise-node.

Related Issues (20)

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.