Class yii\debug\Module does not exist after Update Composer - yii

after Update Composer i have error Class yii\debug\Module does not exist
before run Update Composer my Gii , Debuger in Yii2 is Worked without any Problem.
my Composer.json in Root Yii2 Directory:
{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "~2.0.5",
"yiisoft/yii2-bootstrap": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0",
"yiisoft/yii2-jui": "^2.0"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.0.0",
"yiisoft/yii2-gii": "~2.0.0",
"yiisoft/yii2-faker": "~2.0.0",
"codeception/base": "^2.2.3",
"codeception/verify": "~0.3.1",
"codeception/specify": "~0.4.3"
},
"config": {
"process-timeout": 1800
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject"
]
},
"extra": {
"yii\\composer\\Installer::postCreateProject": {
"setPermission": [
{
"runtime": "0777",
"web/assets": "0777",
"yii": "0755"
}
],
"generateCookieValidationKey": [
"config/web.php"
]
},
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
Result:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 8 updates, 53 removals
- Removing bower-asset/typeahead.js (v0.11.1)
- Removing bower-asset/jquery-ui (1.11.4)
- Removing mrlco/yii2-jalali-datepicker (0.1.0)
- Removing bower-asset/persian-datepicker (0.4.5)
- Removing bower-asset/persian-date (0.1.8-patch1)
- Removing codeception/specify (0.4.6)
- Removing codeception/verify (0.3.2)
- Removing codeception/base (2.2.8)
- Removing phpunit/phpunit (5.7.9)
- Removing myclabs/deep-copy (1.6.0)
- Removing phpspec/prophecy (v1.6.2)
- Removing phpdocumentor/reflection-docblock (3.1.1)
- Removing phpdocumentor/type-resolver (0.2.1)
- Removing phpdocumentor/reflection-common (1.0)
- Removing webmozart/assert (1.2.0)
- Removing phpunit/php-timer (1.0.8)
- Removing phpunit/phpunit-mock-objects (3.4.3)
- Removing doctrine/instantiator (1.0.5)
- Removing sebastian/global-state (1.1.1)
- Removing sebastian/object-enumerator (2.0.0)
- Removing sebastian/resource-operations (1.0.0)
- Removing phpunit/php-code-coverage (4.0.5)
- Removing phpunit/php-file-iterator (1.4.2)
- Removing phpunit/php-text-template (1.2.1)
- Removing phpunit/php-token-stream (1.4.9)
- Removing sebastian/code-unit-reverse-lookup (1.0.0)
- Removing sebastian/environment (2.0.0)
- Removing sebastian/version (2.0.1)
- Removing guzzlehttp/psr7 (1.3.1)
- Removing psr/http-message (1.0.1)
- Removing symfony/finder (v3.2.2)
- Removing symfony/console (v3.2.2)
- Removing symfony/debug (v3.2.2)
- Removing psr/log (1.0.2)
- Removing symfony/event-dispatcher (v3.2.2)
- Removing symfony/yaml (v3.2.2)
- Removing symfony/browser-kit (v3.2.2)
- Removing symfony/css-selector (v3.2.2)
- Removing symfony/dom-crawler (v3.2.2)
- Removing symfony/polyfill-mbstring (v1.3.0)
- Removing behat/gherkin (v4.4.5)
- Removing sebastian/comparator (1.2.4)
- Removing sebastian/exporter (2.0.0)
- Removing sebastian/recursion-context (2.0.0)
- Removing sebastian/diff (1.4.1)
- Removing yiisoft/yii2-faker (2.0.3)
- Removing fzaninotto/faker (v1.6.0)
- Removing yiisoft/yii2-gii (2.0.5)
- Removing phpspec/php-diff (v1.1.0)
- Removing yiisoft/yii2-debug (2.0.7)
- Removing yiisoft/yii2-jui (2.0.6)
- Removing yiisoft/yii2-swiftmailer (2.0.6)
- Removing swiftmailer/swiftmailer (v5.4.5)
- Updating symfony/inflector (v3.2.8 => v3.3.0): Downloading (100%)
- Updating symfony/property-access (v3.2.8 => v3.3.0): Downloading (100%)
- Updating symfony/options-resolver (v3.2.8 => v3.3.0): Downloading (100%)
- Updating endroid/qrcode (2.1.4 => 2.2.2): Downloading (100%)
- Updating ezyang/htmlpurifier (v4.8.0 => v4.9.2): Downloading (100%)
- Updating bower-asset/jquery.inputmask (3.3.5 => 3.3.6): Downloading (100%)
- Updating yiisoft/yii2 (2.0.11 => 2.0.11.2): Downloading (100%)
- Updating 2amigos/yii2-ckeditor-widget (2.0.1 => 2.0.1): Loading from cache
Writing lock file
Generating autoload files

Related

syntax error, unexpected '#', expecting variable (T_VARIABLE) or '{' or '$'

I'am using php 7.4.27, laravel framework 8.83.7 and installed Laravel Jetstream.
Login & Register can show. After registered, Then an error notification appears in Laravel:
syntax error, unexpected '#', expecting variable (T_VARIABLE) or '{' or '$'
and in code line 12 :
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'jetstream::components.dropdown-link','data' => ['href' => $href,'#click.prevent' => $#clickPrevent]]); ?>
I won't update to php 8. What should i do?
=====edited=====
composer.json file :
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^8.75",
"laravel/jetstream": "^2.7",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"livewire/livewire": "^2.5"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-update-cmd": [
"#php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
Explanation:
The issue comes from the fact that the compiled view version under storage/framework/views is failing to evaluate $#clickPrevent.
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'jetstream::components.dropdown-link','data' => ['href' => $href,'#click.prevent' => $#clickPrevent]]); ?>
This has nothing to do with your current PHP version.
Solution:
I managed to locally reproduce the issue. Here is how I solved it.
Steps:
Publish the Jetstream Livewire components.
Command:
php artisan vendor:publish --tag=jetstream-views
Open the file resources/views/vendor/jetstream/components/switchable-team.blade.php
In the file contents,
Instead of:
<x-dynamic-component :component="$component" href="#" #click.prevent="$root.submit();"> ❌
Use this:
<x-dynamic-component :component="$component" href="#"> ✅
Disclaimer:
Note that this is a temporary solution. Everything works fine for me. As lamented by #IMSoP in a comment, I'm afraid it may affect some unknown functionality. I've opened an issue against the library here:
switchable-team.blade.php compiled Jetstream component throwing an error: syntax error, unexpected token "#", expecting variable or "{" or "$"
Update 10th/April/2022:
Another "more stable" solution stated by #fabpl on the opened Github issue:
I think it's the same bug like [2.x] Fix parse error caused by alpine
shorthand on dynamic-component
#1032
Try to replace #click with x-on:click
https://github.com/laravel/jetstream/issues/1036#issuecomment-1094253898
Addendum:
The issue seems to have been introduced in laravel/jetstream v2.7.2. More specifically Use Alpine's #click.prevent for switching teams.
The good news is that this has been resolved beginning from laravel/jetstream v2.7.3 onwards. More specifically [2.x] Fix parse error caused by alpine shorthand on dynamic-component.
I just tagged v2.7.3 which should fix this. Thanks all 👍
https://github.com/laravel/jetstream/issues/1036#issuecomment-1094332998
Hence, you may simply just upgrade your Jetstream version to v2.7.3 to get the fix. I.e:
Command:
composer update laravel/jetstream:2.7.3
Sample Output:
PS C:\Users\Ivan\Documents\SteveContents\GITHUB\Laravel-8.83.7\laravel-8.83.7> composer update laravel/jetstream:2.7.3
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
- Upgrading laravel/jetstream (v2.7.2 => v2.7.3)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
- Downloading laravel/jetstream (v2.7.3)
- Downloading laravel/jetstream (v2.7.3)
- Downloading laravel/jetstream (v2.7.3)
- Downloading laravel/jetstream (v2.7.3)
- Upgrading laravel/jetstream (v2.7.2 => v2.7.3): Extracting archive
...

ERROR #98123 WEBPACK: Generating development JavaScript bundle failed - unexpected token

I have cloned my repository an then install all packages via npm. When i try to start mu program with gatsby develop i get this error in all files in templates directory.
I've already cleared chache, deleted node_modules and public folders, re-install packages and so on, but nothing worked.
This is is info, which I get from gatsby info:
System:
OS: macOS 11.1
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU # 2.30GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.0.0 - ~/.nvm/versions/node/v14.0.0/bin/node
Yarn: 1.13.0 - ~/.npm-global/bin/yarn
npm: 6.14.4 - ~/.nvm/versions/node/v14.0.0/bin/npm
Languages:
Python: 2.7.16 - /usr/bin/python
Browsers:
Chrome: 87.0.4280.141
Firefox: 78.0.2
Safari: 14.0.2
npmPackages:
gatsby: ^2.30.1 => 2.31.1
gatsby-awesome-pagination: ^0.3.6 => 0.3.6
gatsby-image: ^2.5.0 => 2.10.0
gatsby-plugin-eslint: ^2.0.8 => 2.0.8
gatsby-plugin-fontawesome-css: ^1.0.0 => 1.0.0
gatsby-plugin-manifest: ^2.6.1 => 2.11.0
gatsby-plugin-netlify-cms: ^4.5.0 => 4.9.0
gatsby-plugin-offline: ^3.4.0 => 3.9.0
gatsby-plugin-react-helmet: ^3.4.0 => 3.9.0
gatsby-plugin-sharp: ^2.8.0 => 2.13.1
gatsby-plugin-styled-components: ^3.5.0 => 3.9.0
gatsby-plugin-typography: ^2.10.0 => 2.11.0
gatsby-source-filesystem: ^2.5.0 => 2.10.0
gatsby-transformer-remark: ^2.12.0 => 2.15.0
gatsby-transformer-sharp: ^2.6.0 => 2.11.0
Does anyone have similar problem, or know how to solve it?
It's not a matter of dependencies or configuration, you have a typo in your project. It seems that somewhere in your JavaScript files (maybe in the templates folder) you have a . (dot) that is breaking your code.
To enable optional chaining in any JavaScript project, since it's not a standard feature, you need to:
Install the dependency (#babel/plugin-proposal-optional-chaining):
npm install --save-dev #babel/plugin-proposal-optional-chaining
Or:
yarn add #babel/plugin-proposal-optional-chaining --dev
Enable it in your Babel configuration. In Gatsby, you can create a babel.config.js (or .babelrc) in the root of your project to customize Babel's configuration:
{
"plugins": [
["#babel/plugin-proposal-optional-chaining"]
],
"presets": [
[
"babel-preset-gatsby",
{
"targets": {
"browsers": [">0.25%", "not dead"]
}
}
]
]
}
Fixed by:
problem was my package-lock.json. After we fixed it, everything works
properly :) nevermind

Updating from Laravel 5.8 to 6.0 fails due to dependencies

I'm trying to update from 5.8 to any version 6 Laravel. I've updated the PHP code, but the composer update is problematic for me. I've tried composer update, composer update --with-dependencies, composer install.
Composer isn't something I work with often. Any help is very appreciate! How do I decipher the composer error message to an actionable task? Is there a command that will install the dependencies for Laravel 6?
The error message after composer update:
- Conclusion: don't install laravel/framework v6.0.0
- arcanedev/support 4.5.0 requires illuminate/support ~5.8.0 -> satisfiable by laravel/framework[v5.8.38], illuminate/support[5.8.x-dev, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9].
- arcanedev/support 4.5.0 requires illuminate/support ~5.8.0 -> satisfiable by laravel/framework[v5.8.38], illuminate/support[5.8.x-dev, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.36, v5.8.4, v5.8.8, v5.8.9].
- Can only install one of: laravel/framework[6.x-dev, v5.8.38].
- don't install illuminate/support 5.8.x-dev|don't install laravel/framework 6.x-dev
- don't install illuminate/support v5.8.9|don't install laravel/framework 6.x-dev
- Installation request for laravel/framework ^6.0 -> satisfiable by laravel/framework[6.x-dev, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.10.0, v6.10.1, v6.11.0, v6.12.0, v6.13.0, v6.13.1, v6.14.0, v6.15.0, v6.15.1, v6.16.0, v6.17.0, v6.17.1, v6.18.0, v6.18.1, v6.18.10, v6.18.11, v6.18.12, v6.18.13, v6.18.14, v6.18.15, v6.18.16, v6.18.17, v6.18.18, v6.18.19, v6.18.2, v6.18.20, v6.18.21, v6.18.22, v6.18.23, v6.18.24, v6.18.25, v6.18.26, v6.18.27, v6.18.28, v6.18.29, v6.18.3, v6.18.30, v6.18.31, v6.18.4, v6.18.5, v6.18.6, v6.18.7, v6.18.8, v6.18.9, v6.2.0, v6.3.0, v6.4.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0, v6.9.0].
- Installation request for arcanedev/support ~4.5 -> satisfiable by arcanedev/support[4.5.0].
The composer.json
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"laravel/framework": "^6.0",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"illuminate/support": "~5.8.0|^6.0",
"intervention/image": "^2.4",
"laravel/tinker": "^1.0",
"spatie/laravel-permission": "^3.0"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^2.6",
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0",
"barryvdh/laravel-debugbar": "^3.2",
"arcanedev/log-viewer": "^4.7",
"arcanedev/support": "~4.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
}
}
Just have a look at the error message you've shared: your configuration requires arcanedev/support with the version constraint ~4.5. By peeking into the version list of that package, you can see that there is only one version that can be used, which is 4.5.0, and this package requires illuminate/support with the version constraint ~5.8.0. Obviously, this excludes any later versions of Laravel.
By also updating arcanedev/support to some later version (^5.0 should be fine), you are able to update Laravel. Packagist can help you to inspect the constraints for different versions of that package.

Gatsby build fails with "Cannot read property 'page_blocks' of null"

I have a Gatsby site that retrieves data from a Wordpress Rest endpoint.
I am able to run gatsby develop locally on my laptop, but when I run gatsby build on my server to deploy my site, the process crashes and I get the following output with an error at the end:
success open and validate gatsby-configs - 0.085s
success load plugins - 0.523s
success onPreInit - 0.005s
success delete html and css files from previous builds - 0.021s
info One or more of your plugins have changed since the last time you ran Gatsby. As
a precaution, we're deleting your site's cache to ensure there's no stale data.
success initialize cache - 0.022s
success copy gatsby files - 0.040s
success onPreBootstrap - 0.014s
success createSchemaCustomization - 0.009s
-> wordpress__acf_options fetched : 1
-> wordpress__acf_v2 fetched : 1
-> wordpress__wp_api_menus_v2 fetched : 1
-> wordpress__wp_api_menus_menus_items fetched : 1
-> wordpress__wp_api_menus_menus fetched : 1
-> wordpress__wp_api_menus_menu_locations fetched : 1
-> wordpress__wp_v2 fetched : 1
-> wordpress__POST fetched : 1
-> wordpress__PAGE fetched : 7
-> wordpress__wp_media fetched : 0
-> wordpress__wp_blocks fetched : 0
-> wordpress__wp_types fetched : 1
-> wordpress__wp_statuses fetched : 1
-> wordpress__wp_taxonomies fetched : 1
-> wordpress__CATEGORY fetched : 1
-> wordpress__TAG fetched : 0
-> wordpress__wp_users fetched : 1
-> wordpress__wp_comments fetched : 1
-> wordpress__wp_search fetched : 8
Path: /wp-json/wp/v2/themes?per_page=100&page=1
The server response was "400 Bad Request"
Inner exception message: "Missing parameter(s): status"
success source and transform nodes - 3.437s
warn Plugin `gatsby-source-filesystem` tried to define the GraphQL type `File`, which has already been defined by the plugin `null`.
warn Plugin `gatsby-source-filesystem` tried to define the GraphQL type `File`, which has already been defined by the plugin `null`.
warn Plugin `gatsby-source-filesystem` tried to define the GraphQL type `File`, which has already been defined by the plugin `null`.
success building schema - 0.864s
success createPages - 0.060s
success createPagesStatefully - 0.080s
success onPreExtractQueries - 0.003s
success update schema - 0.048s
success extract queries from components - 0.384s
success write out requires - 0.006s
success write out redirect data - 0.005s
success onPostBootstrap - 0.004s
⠀
info bootstrap finished - 9.141 s
⠀
success Building production JavaScript and CSS bundles - 9.280s
success run queries - 9.547s - 10/10 1.05/s
failed Building static HTML for pages - 0.882s
ERROR #95313
Building static HTML failed for path "/join-us"
See our docs page for more info on this error: https://gatsby.dev/debug-html
10 | const PageTemplate = ({ data }) => (
11 | <Layout>
> 12 | { renderBlocks(data.currentPage.acf.page_blocks, data) }
| ^
13 | </Layout>
14 | );
15 |
WebpackError: TypeError: Cannot read property 'page_blocks' of null
- page.js:12 PageTemplate
src/templates/page.js:12:45
The issue seems to be occurring in the output of a GraphQL query that provides me with the data object. But this doesn't happen in my local setup, and it seems like the GraphQL connection is working and fetching data earlier in the error output. If there were issues with my query or something else then why would the local version be working?
This is the file where the issue is happening:
import React from 'react';
import { graphql } from 'gatsby';
import renderBlocks from '../js/pageBlockRender';
import Layout from '../components/global/Layout';
import '../components/sass/blocks.scss';
const PageTemplate = ({ data }) => (
<Layout>
{ renderBlocks(data.currentPage.acf.page_blocks, data) }
</Layout>
);
export default PageTemplate;
export const pageQuery = graphql`
query ($id: String!) {
currentPage: wordpressPage(id: {eq: $id}) {
title
id
parent {
id
}
template
acf {
page_blocks {
block_type {
acf_fc_layout
cs_title
cs_text
dl_style
hh_background_video
tpc_thought_piece {
post_title
post_excerpt
}
}
wordpress_id
}
}
}
}
`;
I'm using the latest versions of React and React-dom, and per this post I have also tried installing all peer dependencies in node. I've also tried deleting my .cache folder to no avail.
What could be different about gatsby develop and gatsby build that creates this issue?
Could it be the differences between the environment in which the dev and production environment are?
Dev Environment
System:
OS: macOS High Sierra 10.13.6
CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU # 2.70GHz
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 11.10.0 - ~/.nvm/versions/node/v11.10.0/bin/node
Yarn: 1.16.0 - /usr/local/bin/yarn
npm: 6.7.0 - ~/.nvm/versions/node/v11.10.0/bin/npm
Languages:
Python: 2.7.10 - /usr/bin/python
Browsers:
Chrome: 79.0.3945.130
Firefox: 58.0.1
Safari: 11.1.2
npmPackages:
gatsby: ^2.19.5 => 2.19.5
gatsby-image: ^2.2.38 => 2.2.38
gatsby-plugin-react-helmet: ^3.1.18 => 3.1.18
gatsby-plugin-sass: ^2.1.26 => 2.1.26
gatsby-plugin-sharp: ^2.3.13 => 2.3.13
gatsby-plugin-styled-components: ^3.1.14 => 3.1.14
gatsby-source-wordpress: ^3.1.51 => 3.1.51
gatsby-transformer-sharp: ^2.3.12 => 2.3.12
npmGlobalPackages:
gatsby-cli: 2.8.16
Prod Environment:
System:
OS: Linux 4.15 Ubuntu 18.04.3 LTS (Bionic Beaver)
CPU: (4) x64 Intel Xeon Processor (Skylake, IBRS)
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 11.10.0 - ~/.nvm/versions/node/v11.10.0/bin/node
npm: 6.7.0 - ~/.nvm/versions/node/v11.10.0/bin/npm
Languages:
Python: 2.7.17 - /usr/bin/python
npmPackages:
gatsby: ^2.19.5 => 2.19.5
gatsby-image: ^2.2.38 => 2.2.38
gatsby-plugin-react-helmet: ^3.1.18 => 3.1.18
gatsby-plugin-sass: ^2.1.26 => 2.1.26
gatsby-plugin-sharp: ^2.3.13 => 2.3.13
gatsby-plugin-styled-components: ^3.1.14 => 3.1.14
gatsby-source-wordpress: ^3.1.51 => 3.1.51
gatsby-transformer-sharp: ^2.3.12 => 2.3.12
npmGlobalPackages:
gatsby-cli: 2.8.27
Here is my gatsby-config.js
/**
* Configure your Gatsby site with this file.
*
* See: https://www.gatsbyjs.org/docs/gatsby-config/
*/
module.exports = {
siteMetadata: {
title: "{PRIVATE INFO CAN'T MAKE PUBLIC}",
description: "{PRIVATE INFO CAN'T MAKE PUBLIC}",
author: `{PRIVATE INFO CAN'T MAKE PUBLIC}`
},
plugins: [
`gatsby-plugin-react-helmet`,
{
resolve: `gatsby-source-filesystem`,
options: {
name: `pages`,
path: `${__dirname}/src/pages/`,
},
},
{
resolve: `gatsby-source-filesystem`,
options: {
name: `data`,
path: `${__dirname}/src/data/`,
ignore: [`**/\.*`], // ignore files starting with a dot
},
},
'gatsby-plugin-styled-components',
/** Comment this ↓ out to connect Gatsby to the staging site **/
{
resolve: 'gatsby-source-wordpress',
options: {
excludedRoutes: ['/wp/v2/users/**', '/wp/v2/settings*'],
baseUrl: '{PRIVATE INFO CAN'T MAKE PUBLIC}/',
auth: {
htaccess_user: "{PRIVATE INFO CAN'T MAKE PUBLIC}",
htaccess_pass: "{PRIVATE INFO CAN'T MAKE PUBLIC}",
},
protocol: 'https',
hostingWPCOM: false,
useACF: true,
searchAndReplaceContentUrls: {
sourceUrl: '{PRIVATE INFO CAN'T MAKE PUBLIC}/',
replacementUrl: '',
},
},
},
`gatsby-plugin-sass`,
`gatsby-transformer-sharp`,
`gatsby-plugin-sharp`,
{
resolve: `gatsby-source-filesystem`,
options: {
path: `${__dirname}/src/data/`,
},
},
],
}
Here is package.json
{
"name": "gatsby-starter-hello-world",
"private": true,
"description": "A simplified bare-bones starter for Gatsby",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"dependencies": {
"babel-plugin-styled-components": "^1.10.6",
"bootstrap": "^4.4.1",
"gatsby": "^2.19.5",
"gatsby-image": "^2.2.38",
"gatsby-plugin-react-helmet": "^3.1.18",
"gatsby-plugin-sass": "^2.1.26",
"gatsby-plugin-sharp": "^2.3.13",
"gatsby-plugin-styled-components": "^3.1.14",
"gatsby-source-wordpress": "^3.1.51",
"gatsby-transformer-sharp": "^2.3.12",
"jquery": "^3.4.1",
"node-sass": "^4.13.1",
"popper.js": "^1.16.1",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"react-helmet": "^5.2.1",
"sharp": "^0.24.0",
"slash": "^3.0.0",
"styled-components": "^4.4.1",
"typescript": "^3.7.5",
"utf-8-validate": "^5.0.2"
},
"devDependencies": {
"popper": "^1.0.1",
"prettier": "^1.19.1"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-hello-world"
},
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
},
"optionalDependencies": {
"bufferutil": "^4.0.1"
}
}
Any clues?

ava dependencies missing from package-lock.json after upgrading it

I have just upgraded ava in one of my projects using npm install --save-dev ava#0.22.0.
To my surprise, all its dependencies are now missing from package-lock.json:
Added:
+ "version": "0.22.0",
+ "resolved": "https://registry.npmjs.org/ava/-/ava-0.22.0.tgz",
+ "integrity": "sha512-dYxvVDL9CeIcgaQ/FojaBVaL/rnIsXdgPVliDOMe1O5nSsIZEsPYDIzmZ1KnO/cuxeQx1PQbtW6qziiEwQZusg==",
+ "dev": true
Removed:
- "requires": {
- "#ava/babel-preset-stage-4": "1.1.0",
- "#ava/babel-preset-transform-test-files": "3.0.0",
- "#ava/write-file-atomic": "2.2.0",
- "#concordance/react": "1.0.0",
- "ansi-escapes": "2.0.0",
- "ansi-styles": "3.2.0",
- "arr-flatten": "1.1.0",
- "array-union": "1.0.2",
- "array-uniq": "1.0.3",
...
Other than that, my code and tests run as expected.
Why were all the dependencies removed from the package-lock.json file?
Make sure you're consistently using the same version of npm across your team. The latest (5.4.2 at time of writing) has many fixes related to the package-lock.json file, compared to earlier releases.