GithubHelp home page GithubHelp logo

Comments (6)

yahiaboudah avatar yahiaboudah commented on July 24, 2024

I even put it in the html, how do I integrate this child process thing?

from bolt-cep.

justintaylor-dev avatar justintaylor-dev commented on July 24, 2024

For anyone else who finds this thread, child_process is a built-in node module so it doesn't require bundling.

In Bolt, you can import with import { child_process } from "../lib/node";

from bolt-cep.

yahiaboudah avatar yahiaboudah commented on July 24, 2024

Wait, I tried doing that and it's giving me this error:

src/js/lib/node.ts:15:20 - error TS2307: Cannot find module 'child_process' or its corresponding type declarations.

15 ) as typeof import("child_process");

from bolt-cep.

yahiaboudah avatar yahiaboudah commented on July 24, 2024

For the now the error went away, and I am getting a proper build by adding nodeTypes to vite config in (resolve/alias):
{ find: '@nodeTypes', replacement: path.resolve(__dirname, 'node_modules/@types/node') }
and replacing child_process with "@nodeTypes/child_process".

However I will have to use some kind of placeholder to run in the web since the node stuff only runs within Adobe.

Anyway, thanks for the help

from bolt-cep.

justintaylor-dev avatar justintaylor-dev commented on July 24, 2024

Are you running Node.js 16 or up? The /lib/node.ts file already does that by returning a blank object if you're in the browser or the node module if you're in a node environment.

from bolt-cep.

yahiaboudah avatar yahiaboudah commented on July 24, 2024

Node version: v16.13.1

from bolt-cep.

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.