Git Product home page Git Product logo

Comments (5)

janat08 avatar janat08 commented on September 28, 2024 1

close?

from miniflare.

mrbbot avatar mrbbot commented on September 28, 2024

Hey! 👋 It looks like you're trying to import an npm module without a build-step. Workers only natively support modules that are located in your upload directory, not node_modules. Check out https://miniflare.dev/recipes/esbuild.html for an example of using esbuild to bundle your code first. Let me know if you have any issues with this. 👍

from miniflare.

wighawag avatar wighawag commented on September 28, 2024

Hey @mrbbot thanks for the quick answer

I am using the rollup configuration from cloudflare typescript template here : https://github.com/cloudflare/durable-objects-typescript-rollup-esm

I guess the rollup config is missing some option ?

I ll investigate more and might as well switch to esbuild that I am using for my frontend through vite anyway.

from miniflare.

faisalil avatar faisalil commented on September 28, 2024

@janat08 , @wighawag, @mrbbot , I am having the same problem with a different package. I am getting
MiniflareError: Unable to resolve "dist/index.mjs" dependency "perf_hooks": no matching module rules
and I am using the rollback template setup. Any hints for what would fix it?

from miniflare.

janat08 avatar janat08 commented on September 28, 2024

Hey! 👋 It looks like you're trying to import an npm module without a build-step. Workers only natively support modules that are located in your upload directory, not node_modules. Check out https://miniflare.dev/recipes/esbuild.html for an example of using esbuild to bundle your code first. Let me know if you have any issues with this.

from miniflare.

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.