Giter Club home page Giter Club logo

Comments (11)

mccuna avatar mccuna commented on July 28, 2024 1

I've tried deleting the node_modules and using npm, but unfortunately the issue persists.
The versions I'm using are:

  • node: 18.4.0
  • pnpm: 7.5.0
  • npm: 8.12.1

I believe the problem is related to the way the app bundle is created. I've put together a dummy repo with Cloudflare Workers & faunadb (https://github.com/mccuna/faunadb-cloudflare-worker) and it seems that:

  • if wrangler.toml has main = src/index.ts and wrangler handles the bundling, then then a similar error occurs
X [ERROR] [plugin checkForNodeBuiltins] Detected a Node builtin module import while Node compatibility is disabled.
Add node_compat = true to your wrangler.toml file to enable Node compatibility.

    node_modules/faunadb/src/_http/fetchAdapter.js:46:16:
      46 │       : require('http')
         ╵                 ~~~~~~

  This error came from the "onResolve" callback registered here:

    node_modules/wrangler/wrangler-dist/cli.js:121430:11:
      121430 │     build6.onResolve({
  • if wrangler.toml has main = "build/index.js" and I bundle the worker myself using esbuild and format:"esm". Then everything is ok

from faunadb-js.

github-actions avatar github-actions commented on July 28, 2024

Internal ticket number is FE-2503

from faunadb-js.

faunaee avatar faunaee commented on July 28, 2024

Which version of Node.js, npm, and pnpm are you running?

Since pnpm tries to dedupe all of the Node modules installed on a system, you may be encountering a limitation where pnpm cannot yet properly handle Node.js's "built-in" modules.

To test that theory, can you replace your pnpm use with npm? If that works, then it might be worth filing an issue with the pnpm project.

from faunadb-js.

pbteja1998 avatar pbteja1998 commented on July 28, 2024

Facing the same error when using the latest fresh install of Remix with the target set as Cloudflare Workers.

from faunadb-js.

TriangularCube avatar TriangularCube commented on July 28, 2024

Same here, whatever options ES Build is using for Wrangler 2 is tripping over Fauna

from faunadb-js.

runarj avatar runarj commented on July 28, 2024

I notice that there is a PR that adds support for Cloudflare Module Workers. This PR has – sadly – not been merged yet.

Maybe this change will correct the problem with the Fauna driver?

from faunadb-js.

runarj avatar runarj commented on July 28, 2024

I am not sure, but it could be that this problem is two-fold. So to get the Fauna driver to work with Remix using Cloudflare Workers, two issues need to be addressed:

  1. Remix needs to use Cloudflare Module Worker and not Service Worker like today.
  2. Fauna needs to provide an EMS serverless driver like PlanetScale does.

from faunadb-js.

pbteja1998 avatar pbteja1998 commented on July 28, 2024

Still facing the same problem. Would be nice if there is at least some patch that we can add locally to make it work with wrangler2

from faunadb-js.

anurag-loco avatar anurag-loco commented on July 28, 2024

Have you tried to do with Remix and Cloudfare Pages? (not CF workers)

from faunadb-js.

pbteja1998 avatar pbteja1998 commented on July 28, 2024

No, my production application is built with cloudflare workers and also I want to make use of Service Bindings. So, moving to cloudflare pages is a no-go for me at this time.

I want to use service bindings which will only work with Wrangler2, but wrangler2 doesn’t work with Fauna.

from faunadb-js.

ptpaterson avatar ptpaterson commented on July 28, 2024

The latest version of Wrangler 2 (v2.9.1+) is compatible with the JS driver. But we are looking into what we can do to help with the fact that the default setup for Cloudflare and Remix is not working.

cc: @Shadid12

from faunadb-js.

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.