Problem starting Next.js app at locallhost 7777 using yarn dev - next.js

When I try to run my localhost using yarn dev it shows this error:
yarn run v1.22.4 $ next -p 7777 ready - started server on
0.0.0.0:7777, url: http://localhost:7777 TypeError: _jestWorker.Worker is not a constructor
at Object.loadWebpackHook (D:\isc-web\isc-front\node_modules\next\dist\server\config-utils.js:67:20)
at Object.loadConfig [as default] (D:\isc-web\isc-front\node_modules\next\dist\server\config.js:332:29)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async NextServer.loadConfig (D:\isc-web\isc-front\node_modules\next\dist\server\next.js:112:22)
error Command failed with exit code 1. info Visit
https://yarnpkg.com/en/docs/cli/run for documentation about this
command.
It was all working fine before I did npm install --save-dev babel-plugin-styled-components even though I canceled the changes by using git checkout -- . but still got the same problem

If you cancelled dependency changes with git checkout your node_modules may still have the old dependencies installed. Try running npm i again to see if getting updated dependencies resolves the issue.
I can't tell much from this error message and I don't know how far along your project is... Have you seen the official Next.js + styled-components example? https://github.com/vercel/next.js/tree/canary/examples/with-styled-components
Perhaps if you try setting up the library this way instead?

Related

WPRIG WordPress local server silently failing to run site

I'm trying my hand at wordpress theme development with WPRig (on WAMP server).
After installing it as per the tutorials, I'm trying to run it with "npm run build". The gulp and composer tasks seem to complete without any issues and finally it says that the local server (and browser-sync) has started on my localhost, however when I hit the url on my browser(chrome/IE), it spins for a minute and times out.
I couldn't find any issue similar to this anywhere on google/stackoverflow or on the github issues page (https://github.com/wprig/wprig). I hate it when things fail silently !!
There is just one error message right at the start, however I assume the fallback mechanism takes over, hence there is no exit from the build process:
[00:15:00] Failed to load external module #babel/register
[00:15:00] Requiring external module babel-register
Finally I tried to investigate with gulp's verbose mode and got he below output.
C:\wamp64\www\wordpress\wp-content\themes\daddycool (wprig#1.0.4)
λ node --inspect-brk .\node_modules\.bin\gulp --verbose
Debugger listening on ws://127.0.0.1:9229/439d987c-37d1-46f2-81c3-1919a704d817
For help see https://nodejs.org/en/docs/inspector
Debugger attached.
C:\wamp64\www\wordpress\wp-content\themes\daddycool\node_modules\.bin\gulp:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Function.Module.runMain (module.js:676:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
Waiting for the debugger to disconnect...
Other things tried - I have nuked my npm cache...
λ gulp -v
[00:31:53] Failed to load external module #babel/register
[00:31:53] Requiring external module babel-register
[00:31:54] CLI version 2.0.1
[00:31:54] Local version 4.0.0
This is the version of my gulpfile :https://github.com/wprig/wprig/blob/1c8966ec5727323e83e382588cf28aa7a958e51a/gulpfile.babel.js
OK, I went back and looked at Mr. Morten's videos again on the setup and realized that i was doing something wrong.
Essentially, I had no virtual domain for my homepage and my site was basically at http://localhost/wordpress
Whereas, I just only changed the name of proxyURL from wprig:8888 to wordpress:8888 which was obviously wrong. After changing that to 'localhost/wordpress', everything works.
Sorry, I am a beginner (when it comes to web development), so this wasn't obvious to me.

How can I fix this 410 error response from Firebase hosting when deploying from Create React App? [duplicate]

this is my log :
[info] === Deploying to 'test-123'...
[info]
[info] i deploying hosting
[info] i hosting: preparing public directory for upload...
[debug] [2018-10-25T15:39:54.587Z] >>> HTTP REQUEST PUT https://deploy.firebase.com/v1/hosting/test-123/uploads/-LPfsRseOoTTgVVj-keR?fileCount=81&message=
Thu Oct 25 2018 21:09:54 GMT+0530 (India Standard Time)
[debug] [2018-10-25T15:40:00.337Z] <<< HTTP RESPONSE 410
[debug] [2018-10-25T15:40:00.337Z] <<< HTTP RESPONSE BODY undefined
[debug] [2018-10-25T15:40:00.339Z] TypeError: Cannot read property 'error' of undefined
at module.exports (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\responseToError.js:10:13)
at Request._callback (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\lib\api.js:47:25)
at Request.self.callback (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:186:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1163:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage.<anonymous> (C:\Users\user\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\request\request.js:1085:12)
at Object.onceWrapper (events.js:313:30)
[error]
[error] Error: An unexpected error has occurred.
till yesterday everything was fine
when i deploy functions one by one or all at the same time everything works fine
please suggest something if someone knows about it
it says HTTPS ERROR 410 which i googled and found out that means the resource has moved
so the url requested might not be working but when i put that in browser its working fine
and i upgraded node, all npm modules still no luck
I found this response from the firebase-community Slack group https://firebase-community.slack.com:
If you are receiving a 410 error, you will likely need to update your cli version (firebase-tools). Updating to the latest version should fix it. You will need to upgrade your CLI version to at least 4.1.0 (>= 5.1.1 is recommended).
I was using firebase-tools: version 3.18.4 previously, and after upgrading to the latest version (5.1.1), I was able to deploy successfully:
npm install -g firebase-tools#5.1.1
For me only installing specific version worked e.g npm install -g firebase-tools#5.1.1
Update global npm "firebase-tools"
Updating firebase tools with npm update -g firebase-tools fixed this for me. I also had to close my terminal session and open a new one to use the new cli version.
My problem was using nvm the version of firebase-tools was mixed, however this npx firebase deploy worked for me.
Credit goes to heydanhey here github issue
After updating firebase I also needed to run this command.
alias firebase="`npm config get prefix`/bin/firebase"
Upgrading the dependencies for the project may help
npm install --save firebase-functions#latest
This worked for me:
Upgrade firebase npm update -g firebase-tools
Log out firebase logout
Log back in firebase login
Deploy firebase deploy

Potential conflict between polymer build and tur-nr/polymer-redux

Description
I am experiencing unexpected errors when running polymer build after installing and using tur-nr/polymer-redux. Here is the demo repo.
Versions & Environment
polymer-build: v0.18.3 polymer --version
node: v6.10.2
Operating System: macOS Sierra v10.12.4
Steps to reproduce
terminal
git clone https://github.com/maria-le/redux # clone remote repo to your local
cd redux # cd into your local repo
bower install # install bower dependencies
npm install redux # install redux
polymer build # attempt build
Expected results
I expect the build to complete, without errors. Then allow me to serve the packaged build.
Actual results
I get the following errors in the terminal.
Error messages
src/all-locally.html(14,16) error [unknown-polymer-behavior] - Unable to resolve behavior store. Did you import it? Is it annotated with #polymerBehavior?
ReduxStore
src/imported-behavior.html(7,16) error [unknown-polymer-behavior] - Unable to resolve behavior ReduxStore. Did you import it? Is it annotated with #polymerBehavior?
polymerStore
src/imported-store-as-variable.html(10,16) error [unknown-polymer-behavior] - Unable to resolve behavior polymerStore. Did you import it? Is it annotated with #polymerBehavior?
PolymerRedux(reduxStore)
src/imported-store.html(7,16) warning [could-not-determine-behavior-name] - Could not determine behavior name from expression of type
CallExpression
error: Promise rejection: Error: 3 error(s) occurred during build.
error: Error: 3 error(s) occurred during build.
at BuildAnalyzer._done (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:229:36)
at BuildAnalyzer. (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:189:26)
at next (native)
at fulfilled (/usr/local/lib/node_modules/polymer-cli/node_modules/polymer-build/lib/analyzer.js:17:58)
at process._tickCallback (internal/process/next_tick.js:109:7)
References
How to use polymer-redux with polymer-build?
polymer lint and polymer-build fail due to ReduxBehavior not registering properly
#polymerBehavior should still produce a behavior even if we can't evaluate the expression

Grunt error SailsJS when lifting with --no-frontend

I have a Sails Api which the first time boots like a charm.
Press CTRL + C to stop it and then try to start it again. It works, BUT,
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "clean:dev" (clean) task
Warning: Cannot delete files outside the current working directory.
------------------------------------------------------------------------
error: Looks like a Grunt error occurred--
error: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `folderthingy` ?
error:
error: If you think this might be the case, try running:
error: sudo chown -R 501 folderthingy
Well, I check it all, and the folder just is my own and has enough rights. I also put up a 777 for testing purposes but this didn't change a thing.
Then, I decided to clear out all the contents of the .tmp folder and try to boot again. This worked like a charm, .tmp got filled again, and when I stopped the server, tried to reboot it, I got the exact same error message again!
I'm booting with the --no-frontend option, so in fact I don't understand why it even wants to load grunt.
Why is this happening? What's going wrong here?
Why it happens is still not known to mankind, but I fixed it with removing the Gruntfile.
Fixed this by following below steps :
File path in your sails app -> tasks/config/sync.js
// 1. Install it as a local dependency of your Sails app:
// ```
// $ npm install grunt-sync --save-dev --save-exact
// ```
//
//
// 2. Then uncomment the following code:
//
// ```
// // Load Grunt plugin from the node_modules/ folder.
// grunt.loadNpmTasks('grunt-sync');
// ```
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Note: Work for Warning "sync:dev" not found
If you are using Linux, try doing sudo sails lift, you can have problems with permissions (happened to me). If Windows - check that no file manager or some other program is blocking the .tmp folder (also happened to me when I opened the folder in Total Commander).
In any case, since you don't use frontend, you can simply remove some of the grunt tasks (in the folder tasks/ you have README.md which explains which tasks are run in which case) or all of them (see documentation) and you won't have the problem.
i also got this error-
error: ** Grunt :: An error occurred. **
error:
------------------------------------------------------------------------
Aborted due to warnings.
Running "sass:dev" (sass) task
> error: Looks like a Grunt error occurred--
>
> error: Please fix it, then **restart Sails** to continue running tasks
> (e.g. watching for changes in assets)
>
> error: Or if you're stuck, check out the troubleshooting tips below.
error: Troubleshooting tips:
error:
error: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
error:
error: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
error:
error: *-> Or maybe you don't have permissions to access the `.tmp` directory?
error: e.g., `/Users/siyaram.malav/Desktop/repo/project1/.tmp` ?
this error came because it could not find the sass module.And ran following command
sudo gem install sass
it worked for me.
In your case, try running sudo gem install clean command.
it should work.
thanks.
I had the same problem while following this tutorial:
https://www.youtube.com/watch?v=ZE7ye2G_H9Q&index=4&list=PLf8i4fc0zJBzLhOe6FwHpGhBDgqwInJWZ
I created a "linker" folder since that's what the guy did, which then prompted me with the error. It looks like he's using an older version of SailsJS since he runs into no errors.
Did you by any chance create a new folder in the assets folder? If you did, the problem is that grunt isn't able to run tasks on the specific folder since it's not linked with the rest of the assets folders and files. Try placing all newly created files within already existing folders and trying again. This worked for me.

Meteor Up (Mup) deployment error

I am trying to deploy a Meteor project using Mup. Mup Setup worked fine, but when i used the command Mup Deploy i get the following error below:
(Note: I have tried multiple appPaths but i have found no solution)
Meteor Up: Production Quality Meteor Deployments
“ Checkout Kadira!
It's the best way to monitor performance of your app.
Visit: https://kadira.io/mup ”
Building Started: /srv/asm/
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1011:11)
at Process.ChildProcess._handle.onexit (child_process.js:802:34)
Fixed. In order to correct this error i double checked app path:
// Location of app (local directory)
"app": "/srv/asm/",
and uninstalled Meteor, then reinstalled meteor, then ran mup deploy. All is now working correctly.

Resources