Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Babel Error: api.caller is not a function - while trying to install 3.2.0 #37

Open
vbgm opened this issue Jan 11, 2024 · 15 comments
Open
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@vbgm
Copy link

vbgm commented Jan 11, 2024

Describe the bug
When trying to install as per Quck Start, getting an error:

at /Users/***/dev/test-meteor-complete/node_modules/@babel/preset-env/src/index.ts:390:13: api.caller is not a function
   at /Users/***/dev/test-meteor-complete/node_modules/@babel/preset-env/src/index.ts:390:13
   at /Users/***/dev/test-meteor-complete/node_modules/@babel/helper-plugin-utils/src/index.ts:62:12
   at packages/meteor-desktop-bundler/bundler.js:815:28
   at Function.time
   (/Users/***/.meteor/packages/meteor-tool/.2.14.0.963agd.102mc++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/tool-env/tools/tool-env/profile.ts:284:30)
   at MeteorDesktopBundler.processFilesForTarget (packages/meteor-desktop-bundler/bundler.js:499:17)

To Reproduce

  1. Have following packages installed:
  "dependencies": {
    "@babel/runtime": "^7.23.5",
    "less": "^4.2.0",
    "meteor-node-stubs": "^1.2.7",
    "vue": "^3.4.7",
    "vue-meteor-tracker": "^3.0.0-beta.7",
    "vue-router": "^4.2.5"
  },
  "devDependencies": {
    "@meteor-community/meteor-desktop": "^3.2.0",
    "electron": "17.4.11",
    "electron-builder": "24.6.4"
  }
  1. Run command:
    meteor --mobile-server=127.0.0.1:3000 OR npm run desktop

  2. Observe the errors related to @babel api.call

Versions:

  • Meteor version: 2.14
  • Package version: 3.2.0

Additional context

Tried multiple times to reset meteor (deleting .meteor/local folder as well as delete node_modules on multiple steps), tried to add @babel/preset-env and @babel/core - still no luck.

@vbgm vbgm added the bug Something isn't working label Jan 11, 2024
Copy link

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee your issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.

Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know

@vbgm
Copy link
Author

vbgm commented Jan 11, 2024

npm run desktop result:

ERROR  electronApp:  error while transpiling or minifying:  TypeError: api.caller is not a function
    at builder (/Users/***/dev/test-meteor-complete/node_modules/@babel/preset-env/src/index.ts:390:13)
    at /Users/***/dev/test-meteor-complete/node_modules/@babel/helper-plugin-utils/src/index.ts:62:12
    at ElectronApp.transpileAndMinify (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:854:33)
    at ElectronApp.build (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:451:24)
    at MeteorDesktop.run (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/index.js:123:9)
INFO  electronApp:  packing .desktop to asar
VERBOSE  electronApp:  clearing temporary .desktop
INFO  meteorApp:  checking for any mobile platform
INFO  meteorApp:  building meteor app
DEBUG  meteorApp:  clearing build dir
INFO  meteorApp:  acquiring index.html
ERROR  meteorApp:  error while trying to download index.html for web.cordova, be sure that you are running a mobile target or with --mobile-server:  TypeError: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received type boolean (false)
    at Object.writeFileSync (node:fs:2362:5)
    at MeteorApp.copyBuild (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/meteorApp.js:657:20)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at MeteorApp.build (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/meteorApp.js:856:17)
    at ElectronApp.getMeteorClientBuild (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:553:9)
    at ElectronApp.build (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/electronApp.js:464:13)
    at MeteorDesktop.run (/Users/***/dev/test-meteor-complete/node_modules/@meteor-community/meteor-desktop/lib/index.js:123:9) {
  code: 'ERR_INVALID_ARG_TYPE'

@vbgm
Copy link
Author

vbgm commented Jan 11, 2024

A clean repo to try to install to is here:
https://github.com/vbgm/meteor-vue3-less

@vbgm
Copy link
Author

vbgm commented Jan 11, 2024

"@meteor-community/meteor-desktop": "^3.1.1" seem to be working, but hot code push seem to be struggling..

@a4xrbj1
Copy link

a4xrbj1 commented Jan 11, 2024 via email

@MatejJan
Copy link

MatejJan commented Apr 4, 2024

Has anyone been able to find a solution to this yet?

I am also trying to upgrade after having issues with 3.1.0 that (I assume due to babel/present-env) was converting js classes into functions and breaking when class inheritance was used. Not sure how much related to this issue with preset-env is.

Edit: Looks like my issue is probably coming from the Cordova build itself not having pure js classes. Still, would be nice to get updated Meteor Desktop to get higher Electron/Chrome versions.

@StorytellerCZ StorytellerCZ added the help wanted Extra attention is needed label Jun 18, 2024
@msavin
Copy link

msavin commented Jun 19, 2024

Getting the same with 3.2 and a different kind of error with 3.1 - but excited to see this is working! I just updated Color Schemer to 2.16 and it was running at least for development.

Does anyone know what the last working versions of Meteor x Meteor-Desktop were?

@a4xrbj1
Copy link

a4xrbj1 commented Jun 19, 2024

Getting the same with 3.2 and a different kind of error with 3.1 - but excited to see this is working! I just updated Color Schemer to 2.16 and it was running at least for development.

Does anyone know what the last working versions of Meteor x Meteor-Desktop were?

3.2 works fine for me with Meteor 2.16. I haven’t tested it on 3.0x RC? yet.

@msavin
Copy link

msavin commented Jun 19, 2024

@a4xrbj1 nice, and you are able to build a Mac app?

So far, I am able to run but not build

@a4xrbj1
Copy link

a4xrbj1 commented Jun 19, 2024 via email

@msavin
Copy link

msavin commented Jun 19, 2024 via email

@wildhart
Copy link

3.2 works fine for me with Meteor 2.16. I haven’t tested it on 3.0x RC? yet.

@a4xrbj1 are you sure 3.2 is working? I'm trying it with Meteor 2.1.6, and getting the api.caller() is not a function error.

I thought it was working to start with, but then I made a trivial change to my desktop.js file (triggering a change in the desktop hash and a re-build), then I get this error.

@iokill I've tried your 'dirty' fix from dupe #38 by using your branch meteor npm install -D https://github.com/innerspacetrainings/meteor-desktop#preset-env-hotfix and I still get the same error.

In the meantime, 3.1.1 appears to be be working for me so far...

@a4xrbj1
Copy link

a4xrbj1 commented Aug 13, 2024 via email

@wildhart
Copy link

Why would I say it’s working when it’s not? Not sure why you question what I write.

The only reason I questioned it was because, as I wrote, it appeard to be working for me until I made a change to my desktop.js file causing it to be recompiled. Before that the cached desktop build was was working fine.

That's great that it's working for you, and sorry if you took offence at my questioning it.

Would you mind sharing your package.json and desktop settings? You appear to be the only person in this thread for whom it is working.

@a4xrbj1
Copy link

a4xrbj1 commented Aug 13, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants