Giter VIP home page Giter VIP logo

Comments (4)

wmertens avatar wmertens commented on June 10, 2024

Looks like fpvdrone is a binary module and you'll need to add it to your externals as well.

BTW there's rollup-plugin-node-externals to handle the node imports automatically

from qwik.

jappyjan avatar jappyjan commented on June 10, 2024

@wmertens i dont know where you see this / get the idea that "fpvdrone" is even a package?
shure, the word fpv-drone-info is in the file path, but only because thats the name of the project / root project folder...
there is no package with fpvdrone in its name

from qwik.

jappyjan avatar jappyjan commented on June 10, 2024

@wmertens anyway, i tried the plugin you mentioned and now i get another error :D

error during build:
TypeError [PLUGIN_ERROR]: Unknown file extension ".css" for /Users/jappy/code/fpv-drone.info/node_modules/@fontsource-variable/montserrat/wght.css
    at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
    at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
    at defaultLoad (node:internal/modules/esm/load:141:22)
    at async ModuleLoader.load (node:internal/modules/esm/loader:409:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:291:45)

when i configure the plugin to not exclude node_modules, i am back to the original error

vite v5.2.4 building SSR bundle for production...
✓ 51 modules transformed.
x Build failed in 1.90s
error during build:
RollupError: Unexpected character '�'
    at getRollupError (file:///Users/jappy/code/fpv-drone.info/node_modules/rollup/dist/es/shared/parseAst.js:376:41)
    at ParseError.initialise (file:///Users/jappy/code/fpv-drone.info/node_modules/rollup/dist/es/shared/node-entry.js:11158:28)
    at convertNode (file:///Users/jappy/code/fpv-drone.info/node_modules/rollup/dist/es/shared/node-entry.js:12898:10)
    at convertProgram (file:///Users/jappy/code/fpv-drone.info/node_modules/rollup/dist/es/shared/node-entry.js:12218:12)
    at Module.setSource (file:///Users/jappy/code/fpv-drone.info/node_modules/rollup/dist/es/shared/node-entry.js:14042:24)
    at async ModuleLoader.addModuleSource (file:///Users/jappy/code/fpv-drone.info/node_modules/rollup/dist/es/shared/node-entry.js:18681:13)

undefined

this is the config i used:

import { UserConfig, defineConfig } from "vite";
import { qwikVite } from "@builder.io/qwik/optimizer";
import { qwikCity } from "@builder.io/qwik-city/vite";
import { builderDevTools } from "@builder.io/dev-tools/vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { qwikReact } from '@builder.io/qwik-react/vite';
import nodeExternals from 'rollup-plugin-node-externals'

export default defineConfig(() => {
  return {
    plugins: [builderDevTools(), qwikCity(), qwikVite(), tsconfigPaths(), qwikReact()],
    optimizeDeps: {
      exclude: ['@uav.painkillers/pid-analyzer-wasm']
    },
    build: {
      rollupOptions: {
        plugins: [nodeExternals({
          deps: false,
          devDeps: false,
          peerDeps: false,
          optDeps: false,
        })]
      }
    }
  } as UserConfig;
});

i am using @fontsource packages for font managing, seems like the plugin does not like that...

from qwik.

wmertens avatar wmertens commented on June 10, 2024

@wmertens i dont know where you see this / get the idea that "fpvdrone" is even a package?

I shouldn't answer from my phone before coffee ;-)

I saw it complain about the unknown character and I just assumed it was a binary dep but that wouldn't make sense.

You can just put nodeExternals() together with the rest of the plugins.

To figure out which file is problematic, try some console logging debugging like rollup/rollup#1215 (comment)

from qwik.

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.