skip to Main Content

I am using Ubuntu. I tray install deno-vue along this docs https://docs.deno.com/runtime/tutorials/how_to_with_npm/vue
I am getting weird error.

Task dev deno run -A --node-modules-dir npm:vite
error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'getReport')
    at isMusl (file:///home/bbabinski-a/Documents/Udemy/quasar-vite/node_modules/.deno/[email protected]/node_modules/rollup/dist/native.js:5:30)
    at getPackageBase (file:///home/bbabinski-a/Documents/Udemy/quasar-vite/node_modules/.deno/[email protected]/node_modules/rollup/dist/native.js:53:28)
    at Object.<anonymous> (file:///home/bbabinski-a/Documents/Udemy/quasar-vite/node_modules/.deno/[email protected]/node_modules/rollup/dist/native.js:28:21)
    at Object.<anonymous> (file:///home/bbabinski-a/Documents/Udemy/quasar-vite/node_modules/.deno/[email protected]/node_modules/rollup/dist/native.js:81:4)
    at Module._compile (node:module:733:34)
    at Object.Module._extensions..js (node:module:747:10)
    at Module.load (node:module:658:32)
    at Function.Module._load (node:module:539:12)
    at Module.require (node:module:677:19)
    at require (node:module:791:16)

My setup:
-deno 1.38.4
Ubuntu 22.04 Jammy Jellyfish

What am I doing wrong? please help!!

I was trying to install Deno + Vite

2

Answers


  1. I can explain what I did to enable everything to work, but it is not real solution.
    As I understand problem is somewhere in .deno/node_modules.
    isMusl the function during computation error undefined.getReport() is happen. I propose to hardcode its return value (for me false is worked).
    THIS IS NOT REAL SOLUTION! but until real fix will come you can try to use it if it is really important to you and you need it now.
    So I explain what i did:

    • find this file in node_modules (its path, line already displays in your error)
    • copy it into your project (for example _hardcode/native.js
    • comment actual code after is isMusl and hardcode false (or true… for me false is worked).
      how i modify
    • and then upgrade your dev task in your deno.json to make replace original file with this in case if error happen
    "dev": "deno run -A --node-modules-dir npm:vite || mv _hardcode/native.js node_modules/.deno/node_modules/rollup/dist/native.js && deno run -A --node-modules-dir npm:vite"
    

    So it try to make task dev if this error happen it replace problem file with your modified copy and try again. (For me only first run make this error and after file replacement it is never repeat and with another tasks also)

    Login or Signup to reply.
  2. This was fixed recently on https://github.com/denoland/deno/pull/21373

    It should work on future Deno releases.

    For now, you can specify an earlier version of Vite, like this:

    deno run -A --node-modules-dir npm:vite@^4.5.1
    

    It’s probably better than using the monkey-patch approach.

    It worked for me. Note that this issue only affects Linux systems.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search