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

Meteor 3.0 Migrations "ReferenceError: __DYNAMIC_VERSIONS__ is not defined" #36

Open
Sergeant61 opened this issue Jun 11, 2024 · 3 comments

Comments

@Sergeant61
Copy link

Sergeant61 commented Jun 11, 2024

Hello @zodern, I recently migrated my project to Meteor 3.0 and encountered an issue. I found out where the problem is coming from, but what can we do as a solution?

I updated my application sequentially with the following commands:

meteor update --release 3.0-rc.2
meteor reset
rm -rf node_modules
rm -rf package-lock.json
meteor npm i

Then I ran my application.

meteor --settings settings.json --port 4100 --raw-logs

The application runs successfully, but on the client side, the application remains on a white screen and I get the following error in the log.

Uncaught ReferenceError: __DYNAMIC_VERSIONS__ is not defined
    at module (dynamic-import.js:452:16)
    at fileEvaluate (modules-runtime-hot.js:386:7)
    at Module.require (modules-runtime-hot.js:268:27)
    at mod.require (modules.js:295:33)
    at require (modules-runtime-hot.js:308:21)
    at module (dynamic-import.js:30:23)
    at fileEvaluate (modules-runtime-hot.js:386:7)
    at Module.require (modules-runtime-hot.js:268:27)
    at mod.require (modules.js:295:33)
    at Object.require (modules-runtime-hot.js:308:21)

My observation is that when I remove the svelte:compiler setting from package.json and add the [email protected] package to the application, it works.

Below is the content of the packages file and package.json for the application.

packages:

[email protected]             # Packages every Meteor app needs to have
[email protected]       # Packages for a great mobile UX
[email protected]                   # The database Meteor supports right now

[email protected]   # CSS minifier run for production mode
[email protected]    # JS minifier run for production mode
[email protected]                # ECMAScript 5 compatibility for older browsers
[email protected]             # Enable ECMAScript2015+ syntax in app code
[email protected]              # Enable TypeScript syntax in .ts and .tsx modules
[email protected]            # Server-side component of the `meteor shell` command

# [email protected]             # Define static page content in .html files
zodern:melte                          # Meteor package to allow us to create files with the .svelte extension
[email protected]  # Update client in development without reloading the page
zodern:types                          # Enable types from meteor/atmosphere packages

[email protected]
[email protected]
# universe:i18n
[email protected]
[email protected]
[email protected]
mdg:validated-method
# percolate:migrations
[email protected]
[email protected]

package.json:

{
  "name": "namaz-vakti-app",
  "private": true,
  "scripts": {
    "start": "meteor --settings settings.json --port 4100 --raw-logs",
    "start:android": "meteor run android-device --settings settings.json --port 4100 --raw-logs --mobile-server=192.168.1.150",
    "deploy:prod": "mup deploy --config=.deploy/prod/mup.js --settings=.deploy/prod/settings.json --verbose",
    "stop:prod": "mup stop --config=.deploy/prod/mup.js --settings=.deploy/prod/settings.json --verbose",
    "restart:prod": "mup restart --config=.deploy/prod/mup.js --settings=.deploy/prod/settings.json",
    "reconfig:prod": "mup reconfig --config=.deploy/prod/mup.js --settings=.deploy/prod/settings.json",
    "setup:prod": "mup setup --config=.deploy/prod/mup.js --settings=.deploy/prod/settings.json --verbose",
    "ssh:prod": "mup ssh --config=.deploy/prod/mup.js --settings=.deploy/prod/settings.json",
    "logs:prod": "mup logs --tail 200 -f --config=.deploy/prod/mup.js --settings=.deploy/prod/settings.json",
    "shell:prod": "meteor mongo shell --settings=.deploy/prod/settings.json"
  },
  "dependencies": {
    "@babel/runtime": "^7.20.6",
    "@material-tailwind/html": "^2.2.2",
    "@sentry/svelte": "^7.108.0",
    "autoprefixer": "^10.4.17",
    "bcrypt": "^5.1.0",
    "classnames": "^2.5.1",
    "daisyui": "^4.7.2",
    "dayjs": "^1.11.9",
    "hex-to-css-filter": "^5.4.0",
    "meteor-node-stubs": "^1.2.5",
    "notiflix": "^3.2.6",
    "postcss": "^8.4.33",
    "postcss-load-config": "^5.0.2",
    "simpl-schema": "^3.4.1",
    "svelte": "3.54.0",
    "svelte-preprocess": "^5.1.3",
    "tailwindcss": "^3.4.1",
    "tippy.js": "^6.3.7",
    "toastify-js": "^1.12.0"
  },
  "devDependencies": {
    "@types/jquery": "^3.5.16",
    "@types/toastify-js": "^1.11.1",
    "tinro": "^0.6.12",
    "typescript": "^5.2.2"
  },
  "meteor": {
    "mainModule": {
      "client": "client/main.js"
    },
    "nodeModules": {
      "recompile": {
        "svelte": [
          "legacy"
        ]
      }
    },
    "testModule": "tests/main.js"
  },
  "svelte:compiler": {
    "extensions": [
      "svelte",
      "html"
    ],
    "hydratable": true,
    "css": false
  }
}
@zodern
Copy link
Owner

zodern commented Jun 14, 2024

I'm pretty sure this would be improved by meteor/meteor#12675. The build is erroring part way through but Meteor is silently ignoring the error and trying to run the app. I've seen this before with Meteor 3.

@Sergeant61
Copy link
Author

Hello, I recently tried to try meteor 3.0 again, I cannot use svelte: compiler both in my own project and in zero installation. The error is as follows.

[[[[[ ~/works/svelte-deneme-302b4 ]]]]]       

=> Started proxy.                             
=> Started HMR server.                        
=> Started MongoDB.                           
/Users/recepozen/.meteor/packages/meteor-tool/.3.0.2-beta.4.bf63lc.6u4vs++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/runners/run-app.js:380
        throw e;
        ^

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView. Received null
    at Hash.update (node:internal/crypto/hash:115:11)
    at /Users/recepozen/.meteor/packages/meteor-tool/.3.0.2-beta.4.bf63lc.6u4vs++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/watch.ts:329:28
    at Array.forEach (<anonymous>)
    at /Users/recepozen/.meteor/packages/meteor-tool/.3.0.2-beta.4.bf63lc.6u4vs++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/tools/fs/tools/fs/watch.ts:329:8
    at CssOutputResource._get (/tools/isobuild/compiler-plugin.js:1002:19)
    at ClientTarget._emitResources (/tools/isobuild/bundler.js:1301:19)
    at /tools/isobuild/bundler.js:861:7
    at Object.enterJob (/tools/utils/buildmessage.js:387:12)
    at ClientTarget.make (/tools/isobuild/bundler.js:849:5)
    at /tools/isobuild/bundler.js:3293:7
    at /tools/isobuild/bundler.js:3452:25
    at Object.capture (/tools/utils/buildmessage.js:282:5)
    at bundle (/tools/isobuild/bundler.js:3274:18)
    at bundleApp (/tools/runners/run-app.js:584:26)
    at AppRunner._runOnce (/tools/runners/run-app.js:629:35)
    at AppRunner._runApp (/tools/runners/run-app.js:951:23) {
  code: 'ERR_INVALID_ARG_TYPE'
}```

@Sergeant61
Copy link
Author

I found the problem here and sent a pr for a solution. zodern/melte-compiler#11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants