I have started recently with bbb and grunt-bbb and currently I have problems with the bbb jam option.
I have created a project with bbb:init, created a test module and right now I want to add dependencies to codemirror project. So I have added the sentence "codemirror": "2.35.1" to the dependencies section on the package.json file.
The problem is when I execute bbb jam upgrade I get the next error:
<WARN> Task "upgrade" not found. Use --force to continue. </WARN>
Aborted due to warnings.
Running "jam" task
Error: TypeError: Cannot call method 'apply' of undefined
at Object.module.exports (/usr/local/lib/node_modules/bbb/tasks/jam.js:52:10)
at Object.task.registerTask.thisTask.fn (/usr/local/lib/node_modules/bbb/node_modules/grunt/lib/grunt/task.js:58:16)
at Task.<anonymous> (/usr/local/lib/node_modules/bbb/node_modules/grunt/lib/util/task.js:343:36)
at Task.start (/usr/local/lib/node_modules/bbb/node_modules/grunt/lib/util/task.js:359:5)
at Object.grunt.tasks (/usr/local/lib/node_modules/bbb/node_modules/grunt/lib/grunt.js:143:8)
at Object.module.exports [as cli] (/usr/local/lib/node_modules/bbb/node_modules/grunt/lib/grunt/cli.js:36:9)
at Object.<anonymous> (/usr/local/lib/node_modules/bbb/bbb.js:98:7)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
But also I have jam installed and if I run it by hand jam upgrade it works fine.
After that last sentence the codemirror project has been downloaded and the vendor/jam/require.config.js file has been updated but the library is never loaded by "require.js".
Any ideas.
Thanks.
Related
I'm trying to develop a webchat with twilio. I'm using the initial github project https://github.com/twilio-professional-services/flex-selectable-chat-messages and customize it. When I'm running in dev mode (npm start) it's works fine... But after building it ( npn run-script build) and run index.thml in localhost it's doesn't work and I've got this error message in console...
twilio-flex-webchat.prod.js:2467 Uncaught TypeError: Super expression must either be null or a function
at twilio-flex-webchat.prod.js:2467:1
at twilio-flex-webchat.prod.js:2466:1
at Object.<anonymous> (twilio-flex-webchat.prod.js:2465:1)
at n (twilio-flex-webchat.prod.js:152:1)
at Object.<anonymous> (twilio-flex-webchat.prod.js:2302:1)
at n (twilio-flex-webchat.prod.js:152:1)
at Object.<anonymous> (twilio-flex-webchat.prod.js:5467:1)
at n (twilio-flex-webchat.prod.js:152:1)
at Module.<anonymous> (twilio-flex-webchat.prod.js:5598:1)
at n (twilio-flex-webchat.prod.js:152:1)
I have tryed to run it from a server (in a WordPress folder) and I have the same error.
I don't understand this error... Is there someone who has solved this error and how can I fix it?
I started with NextJS, before that I used React a lot.
I run the app on docker (node:18-alpine) if it makes any difference.
I have API thing that I wrote before and published as NPM module. Now I install it with yarn add sjiamnocna/renette-api, it's ok, I can use it with react.
I have file "next-app/utils/API/initapi.ts" containing
import CAPI from "renette-api"
const API = new CAPI()
API.authenticateWithName('abcdef')
API.authorizeWithKey('12345')
export default API
It gives me SyntaxError: Unexpected token 'export'
Nothing I found worked so far, any idea?
EDIT1:
Suppose it fails during the runtime (running yarn dev) because it's successfully built and served for development. The CMD tells the same thing as the browser
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1026:15)
at Module._compile (node:internal/modules/cjs/loader:1061:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1151:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:999:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.renette-api (/home/sjiamnocna/Documents/wrk/docker_test/nginxphppg/next-app/.next/server/pages/index.js:52:18)
at __webpack_require__ (/home/sjiamnocna/Documents/wrk/docker_test/nginxphppg/next-app/.next/server/webpack-runtime.js:33:42) {
page: '/'
}
I have the file in directory next to the pages directory, couldn't that cause anything?
Ok, the solution is "workaround".
I changed the target of my package to ES5, now it exports the old style as NextJS expects it. BUT, if you guys have some trick to make the ES6 imports work, tell me
// before
export default MyClass
// now
module.exports = default
Have a nice day
I am working on upgrading a whole slew of dependencies in the branch https://github.com/skyra-project/skyra.pw/tree/fix/update-dependencies and I'm facing an issue that I've been banging my head over for a couple of hours now with no light at the end of the tunnel so I figured I'd ask it here.
Whenever I run yarn build in this branch I get the following error from NextJS:
info - Loaded env from F:\dev\skyraproject\skyrapw\src\.env.production.local
info - Loaded env from F:\dev\skyraproject\skyrapw\src\.env.production
warn - You have enabled experimental feature(s).
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
warn - SWC minify release candidate enabled. https://nextjs.org/docs/messages/swc-minify-enabled
info - Checking validity of types
> [PWA] Compile client (static)
> [PWA] Auto register service worker with: F:\dev\skyraproject\skyrapw\node_modules\next-pwa\register.js
> [PWA] Service worker: F:\dev\skyraproject\skyrapw\src\public\sw.js
> [PWA] url: /sw.js
> [PWA] scope: /
> [PWA] Compile server
> [PWA] Compile server
info - Creating an optimized production build
info - Compiled successfully
> Build error occurred
F:\dev\skyraproject\skyrapw\node_modules\#mui\material\Grid\Grid.js:1
import _objectWithoutPropertiesLoose from "#babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module._compile (node:internal/modules/cjs/loader:1067:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.8303 (F:\dev\skyraproject\skyrapw\src\.next\server\pages\guilds\[...id].js:6919:18)
at __webpack_require__ (F:\dev\skyraproject\skyrapw\src\.next\server\webpack-runtime.js:25:42) {
type: 'SyntaxError'
}
info - Collecting page data .
Some things I have tried without success:
Searching the NextJS issues and documentation
Setting NextJS back to using Babel instead of SWC
Setting "type": "module" in my package.json
The only thing that is still on my mind for trying is changing all default exports to named exports from '#mui/material' but that would be a big chore to change and I really don't want to go through that without some insight from the people here.
I.. fixed it. I gave the last remark on my post 1 more shot and because I ended up finding the codemod #mui/codemod v5.0.0/top-level-imports documented in the Material-UI repository (yarn dlx #mui/codemod v5.0.0/top-level-imports src/). Figured if it was just running a codemod to change everything to top level named imports I could do that.
Well that did it. I honestly have no idea how or why.. but the problem is fixed. Now the site compiles just fine.
I'm upgrading packages in my Next app, including Next 11 and React v17. I tried everything I could find online but still getting this error.
Here's full console output.
Error: Cannot find module 'react/jsx-dev-runtime'
Require stack:
- /Users/wk/repo/.next/server/pages/_document.js
- /Users/wk/repo/guest/node_modules/next/dist/next-server/server/require.js
- /Users/wk/repo/guest/node_modules/next/dist/next-server/server/load-components.js
- /Users/wk/repo/guest/node_modules/next/dist/next-server/server/api-utils.js
- /Users/wk/repo/guest/node_modules/next/dist/next-server/server/next-server.js
- /Users/wk/repo/guest/node_modules/next/dist/server/next.js
- /Users/wk/repo/guest/node_modules/next/dist/server/lib/start-server.js
- /Users/wk/repo/guest/node_modules/next/dist/cli/next-dev.js
- /Users/wk/repo/guest/node_modules/next/dist/bin/next
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
at Function.mod._resolveFilename (/Users/wk/repo/guest/node_modules/next/dist/build/webpack/require-hook.js:4:1855)
at Function.Module._load (internal/modules/cjs/loader.js:840:27)
at Module.require (internal/modules/cjs/loader.js:1019:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.react/jsx-dev-runtime (/Users/wk/repo/.next/server/pages/_document.js:227:18)
at __webpack_require__ (/Users/wk/repo/.next/server/webpack-runtime.js:33:42)
at eval (webpack-internal:///./src/pages/_document.js:5:79)
at Object../src/pages/_document.js (/Users/wk/repo/.next/server/pages/_document.js:66:1)
at __webpack_require__ (/Users/wk/repo/.next/server/webpack-runtime.js:33:42) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/wk/repo/.next/server/pages/_document.js',
'/Users/wk/repo/guest/node_modules/next/dist/next-server/server/require.js',
'/Users/wk/repo/guest/node_modules/next/dist/next-server/server/load-components.js',
'/Users/wk/repo/guest/node_modules/next/dist/next-server/server/api-utils.js',
'/Users/wk/repo/guest/node_modules/next/dist/next-server/server/next-server.js',
'/Users/wk/repo/guest/node_modules/next/dist/server/next.js',
'/Users/wk/repo/guest/node_modules/next/dist/server/lib/start-server.js',
'/Users/wk/repo/guest/node_modules/next/dist/cli/next-dev.js',
'/Users/wk/repo/guest/node_modules/next/dist/bin/next'
]
}
Would appreciate any suggestions. Thanks!
EDIT
I already tried removing node_modules, yarn.lock file etc.
Updating react and react-dom didn't work?
I had the same problem after updating next, I removed the .next folder before updating react and react-dom and after that it worked. I am not sure that removing the folder is needed.
I updated both react and react-dom to 17.0.2.
I also ran into this issue, and simply removing the webpack folder from .next solved the issue.
I got this error while installing the react app. Perviously, it was working well but, now it started to show this error. How to fix it?
internal/modules/cjs/loader.js:614
throw e;
^
Error: No valid exports main found for 'D:\Programming\react\stores\node_modules\is-promise'
at resolveExportsTarget (internal/modules/cjs/loader.js:611:9)
at applyExports (internal/modules/cjs/loader.js:492:14)
at resolveExports (internal/modules/cjs/loader.js:541:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:643:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:941:27)
at Function.Module._load (internal/modules/cjs/loader.js:847:27)
at Module.require (internal/modules/cjs/loader.js:1016:19)
at require (internal/modules/cjs/helpers.js:69:18)
at Object.<anonymous> (D:\Programming\react\stores\node_modules\run-async\index.js:3:17)
at Module._compile (internal/modules/cjs/loader.js:1121:30) {
code: 'MODULE_NOT_FOUND'
}
Aborting installation.
node has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Done.
i think this issue is related to is-promise issue
https://github.com/then/is-promise/issues/14#issue-606798951
they are working for fixing the bug.