Meteor - error after upgrading to 1.4 - meteor

I was working in a project in Meteor 1.3 and today I upgraded to 1.4 and when i try to run the project after running meteor reset I get the following error:
While loading plugin `compileScss` from package `fourseven:scss`:
/Users/mazinalmaskari/.meteor/packages/fourseven_scss/.2.1.1.xb5zda++os.osx.x86_64+web.browser+web.cordova/plugin.compileScss.os.osx.x86_64/npm/compileScss/node_modules/node-sass/lib/index.js:22:11:
`libsass` bindings not found. Try reinstalling `node-sass`?
at getBinding
(/Users/mazinalmaskari/.meteor/packages/fourseven_scss/.2.1.1.xb5zda++os.osx.x86_64+web.browser+web.cordova/plugin.compileScss.os.osx.x86_64/npm/compileScss/node_modules/node-sass/lib/index.js:22:11)
at Object.<anonymous>
(/Users/mazinalmaskari/.meteor/packages/fourseven_scss/.2.1.1.xb5zda++os.osx.x86_64+web.browser+web.cordova/plugin.compileScss.os.osx.x86_64/npm/compileScss/node_modules/node-sass/lib/index.js:188:23)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load
(/Users/mazinalmaskari/.meteor/packages/meteorhacks_npm/.1.5.0.m71zaz++os+web.browser+web.cordova/plugin.initializing-npm-support.os/npm/initializing-npm-support/node_modules/node-echo/node_modules/coffee-script/lib/coffee-script/register.js:45:36)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous>
(/Users/mazinalmaskari/.meteor/packages/meteor-tool/.1.4.0-1.bf0k83++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/isobuild/bundler.js:1633:22)
at Object.require
(/Users/mazinalmaskari/.meteor/packages/meteor-tool/.1.4.0-1.bf0k83++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/tools/isobuild/bundler.js:1607:31)
at <runJavaScript-18>:15:16
at <runJavaScript-18>:151:4
at <runJavaScript-18>:158:3
=> Your application has errors. Waiting for file change.
And when i remove the package fourseven:scss i get the following error:
While processing files with stylus (for target web.browser):
packages/ian:accounts-ui-bootstrap-3/accounts_ui.styl: Stylus compiler error: accounts_ui.styl:85:2
81| }
82| .btn-Twitter{
83| color: white;
84| background-color: #4099FF;
85| }
--------^
86|
87|
fs.exists is not a function
=> Your application has errors. Waiting for file change.
Any advice on what should i do here please? is there a way to downgrade to meteor 1.4?

I got the problem fixed by executing the following steps:
meteor remove fourseven:scss
meteor add fourseven:scss#=3.8.1'
for the second problem, I has to move stylus package and add it again because for some reason downloading ian:accounts-ui-bootstrap-3 doesn't come with the latest version of stylus
meteor remove stylus
meteor add stylus#=2.513.4

First try running a meteor reset (warning: this will wipe your local Mongo DB).
If that doesn't work, with the fourseven:scss package added to your project, try:
cd yourproject
npm uninstall node-sass
meteor npm install --save-dev node-sass

Try running your app as root
$ sudo meteor

Related

Firebase deployment works locally but not on GitHub Action

I'm trying to build a CI/CD pipeline for my project that uses Firebase Cloud Functions.
The functions code is written in TypeScript.
Deploying the code from my local MacBook works perfectly. However, when deploying the same exact code from the GitHub Action runner it fails with an error:
/home/runner/work/geonotes-backend/geonotes-backend/functions/lib/handlers/createNoteActionHandler.js:11
return sendOutput({ note_id: note?.id });
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:1052:16)
at Module._compile (internal/modules/cjs/loader.js:1100:27)
at Module._compile (pkg/prelude/bootstrap.js:1394:32)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
at Module.load (internal/modules/cjs/loader.js:984:32)
at Function.Module._load (internal/modules/cjs/loader.js:877:14)
at Module.require (internal/modules/cjs/loader.js:1024:19)
at Module.require (pkg/prelude/bootstrap.js:1338:31)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.<anonymous> (/home/runner/work/geonotes-backend/geonotes-backend/functions/lib/index.js:28:51)
This looks like Firebase is not accepting the optional chaining syntax, but it should since the function runs on Node.js 14.
Furthermore, the same syntax is accepted perfectly by the CLI running on my machine.
I have verified that both my machine and the GitHub runner are using the same versions:
Node.js v14.17.4
NPM v6.14.14
Firebase CLI v9.16.0
TypeScript v4.3.5
I have also tried to run my action on macos-latest instead of ubuntu-latest with no luck.
This is one of the runs that is failing, with --debug enabled:
https://github.com/emilioschepis/geonotes-backend/runs/3261106553
Does anyone have an idea about what could be wrong?

Can not run server after add sentry to nextjs project

I prefer the docs from https://docs.sentry.io/platforms/javascript/guides/nextjs to add #sentry/nextjs to my project. Then i added their config to my next.config.js
const { withSentryConfig } = require('#sentry/nextjs');
// module.exports = withBundleAnalyzer(nextConfig)
module.exports = {
}
const moduleExports = module.exports
const SentryWebpackPluginOptions = {
// Additional config options for the Sentry Webpack plugin. Keep in mind that
// the following options are set automatically, and overriding them is not
// recommended:
// release, url, org, project, authToken, configFile, stripPrefix,
// urlPrefix, include, ignore
silent: true, // Suppresses all logs
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options.
};
// Make sure adding Sentry options is the last code to run before exporting, to
// ensure that your source maps include changes from all other Webpack plugins
module.exports = withSentryConfig(moduleExports, SentryWebpackPluginOptions);
Everythings seem to be fine before i run my server by yarn dev and got this error
Error: Could not find a valid build in the 'C:\Users\DELL\Desktop\ws-or\fjob-frontend\.next' directory! Try building your app with 'next build' before starting the server.
at Server.readBuildId (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\next\dist\next-server\server\next-server.js:137:355)
at new Server (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\next\dist\next-server\server\next-server.js:3:120)
at Function.createServer [as default] (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\next\dist\server\next.js:2:638)
at Object.instrumentServer (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\#sentry\nextjs\dist\utils\instrumentServer.js:42:67)
at Object.<anonymous> (C:\Users\DELL\Desktop\ws-or\fjob-frontend\node_modules\#sentry\nextjs\dist\index.server.js:56:20)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14)
at Module.require (internal/modules/cjs/loader.js:957:19)
(node:4084) Warning: Accessing non-existent property 'default' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4084) Warning: Accessing non-existent property 'target' of module exports inside circular dependency
(node:4084) Warning: Accessing non-existent property 'amp' of module exports inside circular dependency
(node:4084) Warning: Accessing non-existent property 'experimental' of module exports inside circular dependency
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
After days of research i can not resolve this error. My nextjs config is empty and i do not think this is the problem of next. If i remove the sentry config, i can start my server like normal. Any idea?
The solution to this problem is, upgrade next.js to >= 10.0.8 github.com/getsentry/sentry-javascript/issues/3724
Upgrade Next.js version to latest works for me
run to upgrade to the latest version
npm install next#latest or yarn add next#latest
check here for more info
What worked for me was removing .sentryclirc from my .gitignore file.
It was added automatically by Sentry there, and so it wasn't being added to the build.
(In case it helps someone)

Framer-motion import breaks page Next Js

Hi I am trying to import framer-motion into a page in Next Js.
import { motion } from "framer-motion"
This breaks the page. I get the following error in terminal:
/Users/.../Sites/.../node_modules/framer-motion/dist/es/index.js:1
export { MotionConfig, MotionConfigContext } from './context/MotionConfigContext.js';
^^^^^^
SyntaxError: Unexpected token 'export'
at wrapSafe (internal/modules/cjs/loader.js:931:16)
at Module._compile (internal/modules/cjs/loader.js:979:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at eval (webpack-internal:///framer-motion:1:18)
at Object.framer-motion (/Users/.../Sites/.../.next/server/pages/work.js:446:1)
at __webpack_require__ (/Users/.../Sites/.../.next/server/pages/work.js:23:31)
I can't see any documentation on this problem anywhere.
Thanks,
I hit this same error. I noticed that Framer Motion (3.10.5) and Next (10.0.9) were both updated in the last 16 hours.
I ran npm update and it fixed this error for me but note that this command updates everything in your package.
If you are worried about breaking changes try updating just the two packages framer and next - npm update framer-motion next or yarn upgrade framer-motion next
I had the same issue, You just need to update your packages.
npm update

Meteor\Ionic3 - cannot read property 'versions' of undefined after installing meteor-client-bundler

I'm doing this tutorial, which combines the Ionic CLI with Meteor. Everything was fine until it asked me to install meteor-client-bundler. After adding this to package.json:
"meteor-client:bundle": "meteor-client bundle -s api"
And running the commands:
npm install --save-dev tmp
npm run meteor-client:bundle
A new file called meteor-client.js was added to my node_modules folder (as expected). However, when I try importing it via:
import 'meteor-client';
My app crashes and I get this error:
Uncaught TypeError: Cannot read property 'versions' of undefined
at autoupdate_client.js (meteor-client.js:40130)
at fileEvaluate (meteor-client.js:1535)
at Module.require (meteor-client.js:1438)
at _require (meteor-client.js:1457)
at meteor-client.js:40302
at Object.<anonymous> (meteor-client.js:40308)
at Object.module.exports (vendor.js:146981)
at __webpack_require__ (bootstrap 38e1b6bf8728472217f2:54)
at Object.478 (main.ts:1)
at __webpack_require__ (bootstrap 38e1b6bf8728472217f2:54)
The problem appears to be in this line of code:
const autoupdateVersions = __meteor_runtime_config__.autoupdate.versions[clientArch] || {
version: "unknown",
versionRefreshable: "unknown",
versionNonRefreshable: "unknown",
assets: []
};
Where apperently versions is undefined. But the code is extremely long and convoluted, I'm not entirely sure how to go about this.

Attempting to use 'pkg' to build 'nextjs' app results in dependency errors and/or 404 errors once built

I'm attempting to build an executable of a small NextJS example app based on the example here using zeit/pkg. Problem is the only feasible entry point (server.js) seems to give me a bunch of errors not currently listed in their issues related to webpack compilation.
If you'd like to reproduce just follow the instructions here and then add pkg. Also - here's the error output below.
ERROR Failed to compile with 2 errors
10:48:35 AM These dependencies were not found:
#babel/runtime/helpers/extends in D:/snapshot/pkg-ssr/node_modules/next/dist/lib/app.js
webpack-hot-middleware/client?autoConnect=false&overlay=false&reload=true
in
D:/snapshot/pkg-ssr/node_modules/next/dist/client/webpack-hot-middleware-client.js
To install them, you can run: npm install --save
#babel/runtime/helpers/extends
webpack-hot-middleware/client?autoConnect=false&overlay=false&reload=true
(node:15964) DeprecationWarning: Module.chunks: Use
Module.forEachChunk/mapChunks/getNumberOfChunks/isInChunk/addChunk/removeChunk
instead
Ready on http://localhost:3000 Client pings, but there's no entry for page: /about { Error: Cannot find module
'D:_experiments\pkg-ssr.next\build-manifest.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:592:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1278:46)
at Function.Module._load (internal/modules/cjs/loader.js:518:25)
at Module.require (internal/modules/cjs/loader.js:648:17)
at Module.require (pkg/prelude/bootstrap.js:1157:31)
at require (internal/modules/cjs/helpers.js:20:18)
at _callee3$ (D:\snapshot\pkg-ssr\node_modules\next\dist\server\render.js:202:29)
at tryCatch (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:62:40)
at Generator.invoke [as _invoke] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:296:22)
at Generator.forEach.prototype.(anonymous function) [as next] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:114:21)
at step (D:\snapshot\pkg-ssr\node_modules\#babel\runtime\helpers\asyncToGenerator.js:12:30)
at _next (D:\snapshot\pkg-ssr\node_modules\#babel\runtime\helpers\asyncToGenerator.js:27:9)
at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' } Client pings, but there's no entry for
page: /about { Error: Cannot find module
'D:_experiments\pkg-ssr.next\build-manifest.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:592:15)
at Function.Module._resolveFilename (pkg/prelude/bootstrap.js:1278:46)
at Function.Module._load (internal/modules/cjs/loader.js:518:25)
at Module.require (internal/modules/cjs/loader.js:648:17)
at Module.require (pkg/prelude/bootstrap.js:1157:31)
at require (internal/modules/cjs/helpers.js:20:18)
at _callee3$ (D:\snapshot\pkg-ssr\node_modules\next\dist\server\render.js:202:29)
at tryCatch (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:62:40)
at Generator.invoke [as _invoke] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:296:22)
at Generator.forEach.prototype.(anonymous function) [as next] (D:\snapshot\pkg-ssr\node_modules\regenerator-runtime\runtime.js:114:21)
at step (D:\snapshot\pkg-ssr\node_modules\#babel\runtime\helpers\asyncToGenerator.js:12:30)
at _next (D:\snapshot\pkg-ssr\node_modules\#babel\runtime\helpers\asyncToGenerator.js:27:9)
at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
In my case, the issue was that I wasn't packaging a built app. I needed to do a few things:
specify the assets and scripts in the package.json like below (note that dist was actually server in my case because I had a custom server and middleware)
"pkg": {
"assets": [
".next/**/*"
],
"scripts": [
".next/dist/**/*.js"
]
},
build the app first using next build
then ensure that whichever way I built the package, I used the package.json. For me the best command was their default example: pkg .
See the following article from Mike Hsu in case you want a repo and instructions to compare to: https://medium.com/#evenchange4/deploy-a-commercial-next-js-application-with-pkg-and-docker-5c73d4af2ee

Resources