strapi / strapi

🚀 Strapi is the leading open-source headless CMS. It’s 100% JavaScript/TypeScript, fully customizable and developer-first.
https://strapi.io
Other
62.74k stars 7.88k forks source link

Can't run `yarn develop` with `--watch-admin` flag #16266

Closed ingowonner closed 1 year ago

ingowonner commented 1 year ago

Bug report

If I try to start a fresh Strapi v4.9.0 project with yarn develop --watch-admin or just yarn strapi watch-admin it throws errors for some exports which can't be found. The Strapi Admin UI is not reachable.

Required System information

Describe the bug

The logs of the yarn strapi watch-admin command. It's basically the same for yarn develop --watch-admin.

yarn run v1.22.19
$ strapi watch-admin
Starting the compilation for TypeScript files in /Users/ingo/Downloads/teststrapi/my-project
Starting the development server...

Admin development at http://localhost:8000/admin/
assets by path *.js 37.8 MiB
  assets by chunk 14.3 MiB (id hint: vendors)
    asset vendors-node_modules_codemirror5_addon_display_placeholder_js-node_modules_highlight_js_lib_i-100ed6.chunk.js 6.85 MiB [emitted] (id hint: vendors)
    asset vendors-node_modules_date-fns_esm_locale_index_js.chunk.js 3.4 MiB [emitted] (id hint: vendors)
    asset content-type-builder.chunk.js 993 KiB [emitted] (name: content-type-builder) (id hint: vendors)
    + 35 assets
  + 153 assets
assets by info 19.4 KiB [immutable]
  assets by path *.svg 14 KiB
    assets by chunk 12.5 KiB (auxiliary name: Admin_homePage) 3 assets
    + 2 assets
  assets by path *.png 5.36 KiB
    asset 19eb2dfcf2603eb55733.png 2.84 KiB [emitted] [immutable] [from: .cache/admin/src/assets/images/onboarding-preview.png] (auxiliary name: Admin-authenticatedApp)
    asset 27d16aefee06412db90a.png 2.52 KiB [emitted] [immutable] [from: .cache/admin/src/pages/HomePage/assets/strapi-cloud-background.png] (auxiliary name: Admin_homePage)
asset index.html 872 bytes [emitted]
Entrypoint main 15.3 MiB = runtime~main.bundle.js 51 KiB main.bundle.js 15.3 MiB
orphan modules 688 KiB [orphan] 349 modules
runtime modules 33.8 KiB 19 modules
modules by path ./node_modules/ 9.78 MiB
  javascript modules 9.22 MiB 2779 modules
  json modules 566 KiB
    optional modules 494 KiB [optional] 104 modules
    + 7 modules
modules by path ./.cache/ 3.08 MiB (javascript) 19.4 KiB (asset)
  javascript modules 1.77 MiB 649 modules
  json modules 1.32 MiB 35 modules
  asset modules 996 bytes (javascript) 19.4 KiB (asset) 8 modules
+ 7 modules

WARNING in ./.cache/admin/src/content-manager/pages/App/index.js 75:483-491
export 'NotFound' (imported as 'NotFound') was not found in '@strapi/helper-plugin' (possible exports: AnErrorOccurred, AppInfosContext, AutoReloadOverlayBockerContext, CheckPagePermissions, CheckPermissions, ConfirmDialog, ContentBox, ContentManagerEditViewDataManagerContext, CustomFieldsProvider, DateTimePicker, DynamicTable, EmptyBodyTable, EmptyStateLayout, FilterListURLQuery, FilterPopoverURLQuery, Form, GenericInput, GuidedTourProvider, InjectionZone, LibraryProvider, Link, LinkButton, LoadingIndicatorPage, NoContent, NoMedia, NoPermissions, NotAllowedInput, NotificationsContext, NotificationsProvider, OverlayBlockerContext, PageSizeURLQuery, PaginationURLQuery, RBACProviderContext, ReactSelect, RelativeTime, RemoveRoundedButton, SearchURLQuery, SettingsPageTitle, SortIcon, Status, StopPropagation, StrapiAppProvider, TrackingContext, TrackingProvider, auth, contentManagementUtilRemoveFieldsFromData, difference, findMatchingPermissions, formatContentTypeData, getAPIInnerErrors, getFetchClient, getFileExtension, getOtherInfos, getType, getYupInnerErrors, hasPermissions, normalizeAPIError, onRowClick, prefixFileUrlWithBackendUrl, prefixPluginTranslations, pxToRem, request, setHexOpacity, stopPropagation, to, translatedErrors, useAPIErrorHandler, useAppInfos, useAutoReloadOverlayBlocker, useCMEditViewDataManager, useCustomFields, useFetchClient, useFocusWhenNavigate, useGuidedTour, useLibrary, useLockScroll, useNotification, useOverlayBlocker, usePersistentState, useQuery, useQueryParams, useRBAC, useRBACProvider, useSelectionState, useStrapiApp, useTracking, wrapAxiosInstance)
 @ ./.cache/admin/src/pages/Admin/index.js 17:8-20:3
 @ ./.cache/admin/src/components/PluginsInitializer/index.js 5:0-38 28:45-50
 @ ./.cache/admin/src/components/AuthenticatedApp/index.js 15:0-55 95:229-247
 @ ./.cache/admin/src/pages/App/index.js 27:8-30:3
 @ ./.cache/admin/src/StrapiApp.js 14:0-30 394:110-113
 @ ./.cache/admin/src/index.js 44:26-47:3

WARNING in ./.cache/admin/src/pages/MarketplacePage/components/EmptyNpmPackageSearch/index.js 9:394-412
export 'EmptyStateDocument' (imported as 'EmptyStateDocument') was not found in '@strapi/icons' (possible exports: Alien, Apps, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Attachment, Bell, Bold, Book, Boolean, Briefcase, Brush, BulletList, Calendar, Car, CarretDown, CarretUp, Cast, ChartBubble, ChartCircle, ChartPie, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clock, Cloud, CloudUpload, Code, CodeSquare, Cog, Collapse, CollectionType, Command, Component, Connector, Crop, Cross, CrossCircle, Crown, Cup, Cursor, Dashboard, Database, Date, Discord, Discourse, Discuss, Doctor, Dot, Download, Drag, Duplicate, DynamicZone, Earth, EarthStriked, Email, EmotionHappy, EmotionUnhappy, EmptyDocuments, EmptyPermissions, EmptyPictures, Enumeration, Envelop, Equalizer, ExclamationMarkCircle, Exit, Expand, ExternalLink, Eye, EyeStriked, Facebook, Feather, FeatherSquare, File, FileError, FilePdf, Filter, Folder, Gate, Gift, Github, GlassesSquare, Globe, GraphQl, Grid, HandHeart, Hashtag, Headphone, Heart, House, IndentDecrease, IndentIncrease, Information, InformationSquare, Italic, Json, Key, Landscape, LandscapeSmall, Layer, Layout, Lightbulb, Link, LinkSmall, List, Loader, Lock, Magic, Mail, ManyToMany, ManyToOne, ManyWays, Media, Medium, MenuBurger, Message, Microphone, Minus, MinusOutlined, Monitor, Moon, More, Move, Music, Number, NumberList, OneToMany, OneToOne, OneWay, OnholdCarretDown, OnholdCarretUp, Paint, PaintBrush, PaperPlane, Password, Pencil, Phone, Picture, PicturePlus, Pin, PinMap, Plane, Play, PlaySquare, Plus, PlusCircle, PriceTag, Puzzle, Question, Quote, QuoteClosed, Reddit, Refresh, Relation, Repeat, Restaurant, RichText, Rocket, Rotate, Scissors, Search, SearchIcon, Seed, Server, Shield, Shirt, ShoppingCart, SingleType, Slideshow, Spinner, Stack, Star, Store, Strapi, StrikeThrough, Sun, Television, Text, ThumbDown, ThumbUp, Train, Trash, Twitter, Typhoon, Uid, Underline, Upload, User, VolumeMute, VolumeUp, Walk, Wheelchair, Write)
 @ ./.cache/admin/src/pages/MarketplacePage/index.js 32:0-71 234:201-222 244:154-175
 @ ./.cache/admin/src/pages/Admin/index.js 33:8-36:3
 @ ./.cache/admin/src/components/PluginsInitializer/index.js 5:0-38 28:45-50
 @ ./.cache/admin/src/components/AuthenticatedApp/index.js 15:0-55 95:229-247
 @ ./.cache/admin/src/pages/App/index.js 27:8-30:3
 @ ./.cache/admin/src/StrapiApp.js 14:0-30 394:110-113
 @ ./.cache/admin/src/index.js 44:26-47:3

WARNING in ./node_modules/@strapi/plugin-content-type-builder/admin/src/components/AttributeOptions/EmptyAttributes/index.js 27:387-405
export 'EmptyStateDocument' (imported as 'EmptyStateDocument') was not found in '@strapi/icons' (possible exports: Alien, Apps, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Attachment, Bell, Bold, Book, Boolean, Briefcase, Brush, BulletList, Calendar, Car, CarretDown, CarretUp, Cast, ChartBubble, ChartCircle, ChartPie, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clock, Cloud, CloudUpload, Code, CodeSquare, Cog, Collapse, CollectionType, Command, Component, Connector, Crop, Cross, CrossCircle, Crown, Cup, Cursor, Dashboard, Database, Date, Discord, Discourse, Discuss, Doctor, Dot, Download, Drag, Duplicate, DynamicZone, Earth, EarthStriked, Email, EmotionHappy, EmotionUnhappy, EmptyDocuments, EmptyPermissions, EmptyPictures, Enumeration, Envelop, Equalizer, ExclamationMarkCircle, Exit, Expand, ExternalLink, Eye, EyeStriked, Facebook, Feather, FeatherSquare, File, FileError, FilePdf, Filter, Folder, Gate, Gift, Github, GlassesSquare, Globe, GraphQl, Grid, HandHeart, Hashtag, Headphone, Heart, House, IndentDecrease, IndentIncrease, Information, InformationSquare, Italic, Json, Key, Landscape, LandscapeSmall, Layer, Layout, Lightbulb, Link, LinkSmall, List, Loader, Lock, Magic, Mail, ManyToMany, ManyToOne, ManyWays, Media, Medium, MenuBurger, Message, Microphone, Minus, MinusOutlined, Monitor, Moon, More, Move, Music, Number, NumberList, OneToMany, OneToOne, OneWay, OnholdCarretDown, OnholdCarretUp, Paint, PaintBrush, PaperPlane, Password, Pencil, Phone, Picture, PicturePlus, Pin, PinMap, Plane, Play, PlaySquare, Plus, PlusCircle, PriceTag, Puzzle, Question, Quote, QuoteClosed, Reddit, Refresh, Relation, Repeat, Restaurant, RichText, Rocket, Rotate, Scissors, Search, SearchIcon, Seed, Server, Shield, Shirt, ShoppingCart, SingleType, Slideshow, Spinner, Stack, Star, Store, Strapi, StrikeThrough, Sun, Television, Text, ThumbDown, ThumbUp, Train, Trash, Twitter, Typhoon, Uid, Underline, Upload, User, VolumeMute, VolumeUp, Walk, Wheelchair, Write)
 @ ./node_modules/@strapi/plugin-content-type-builder/admin/src/components/AttributeOptions/CustomFieldsList/index.js 5:0-49 14:47-62
 @ ./node_modules/@strapi/plugin-content-type-builder/admin/src/components/AttributeOptions/index.js 18:0-50 37:266-282
 @ ./node_modules/@strapi/plugin-content-type-builder/admin/src/components/FormModal/index.js 35:0-51 764:4-20
 @ ./node_modules/@strapi/plugin-content-type-builder/admin/src/components/DataManagerProvider/index.js 27:0-37 462:223-232
 @ ./node_modules/@strapi/plugin-content-type-builder/admin/src/pages/App/index.js 9:0-71 32:271-290
 @ ./node_modules/@strapi/plugin-content-type-builder/admin/src/index.js 21:32-24:9
 @ ./node_modules/@strapi/plugin-content-type-builder/strapi-admin.js 2:0-47
 @ ./.cache/admin/src/plugins.js 3:0-107 9:26-44
 @ ./.cache/admin/src/index.js 7:0-32 49:16-23

WARNING in ./node_modules/@strapi/plugin-upload/admin/src/components/EmptyAssets/index.js 7:508-527
export 'EmptyStateDocuments' (imported as 'EmptyStateDocuments') was not found in '@strapi/icons' (possible exports: Alien, Apps, Archive, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Attachment, Bell, Bold, Book, Boolean, Briefcase, Brush, BulletList, Calendar, Car, CarretDown, CarretUp, Cast, ChartBubble, ChartCircle, ChartPie, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clock, Cloud, CloudUpload, Code, CodeSquare, Cog, Collapse, CollectionType, Command, Component, Connector, Crop, Cross, CrossCircle, Crown, Cup, Cursor, Dashboard, Database, Date, Discord, Discourse, Discuss, Doctor, Dot, Download, Drag, Duplicate, DynamicZone, Earth, EarthStriked, Email, EmotionHappy, EmotionUnhappy, EmptyDocuments, EmptyPermissions, EmptyPictures, Enumeration, Envelop, Equalizer, ExclamationMarkCircle, Exit, Expand, ExternalLink, Eye, EyeStriked, Facebook, Feather, FeatherSquare, File, FileError, FilePdf, Filter, Folder, Gate, Gift, Github, GlassesSquare, Globe, GraphQl, Grid, HandHeart, Hashtag, Headphone, Heart, House, IndentDecrease, IndentIncrease, Information, InformationSquare, Italic, Json, Key, Landscape, LandscapeSmall, Layer, Layout, Lightbulb, Link, LinkSmall, List, Loader, Lock, Magic, Mail, ManyToMany, ManyToOne, ManyWays, Media, Medium, MenuBurger, Message, Microphone, Minus, MinusOutlined, Monitor, Moon, More, Move, Music, Number, NumberList, OneToMany, OneToOne, OneWay, OnholdCarretDown, OnholdCarretUp, Paint, PaintBrush, PaperPlane, Password, Pencil, Phone, Picture, PicturePlus, Pin, PinMap, Plane, Play, PlaySquare, Plus, PlusCircle, PriceTag, Puzzle, Question, Quote, QuoteClosed, Reddit, Refresh, Relation, Repeat, Restaurant, RichText, Rocket, Rotate, Scissors, Search, SearchIcon, Seed, Server, Shield, Shirt, ShoppingCart, SingleType, Slideshow, Spinner, Stack, Star, Store, Strapi, StrikeThrough, Sun, Television, Text, ThumbDown, ThumbUp, Train, Trash, Twitter, Typhoon, Uid, Underline, Upload, User, VolumeMute, VolumeUp, Walk, Wheelchair, Write)
 @ ./node_modules/@strapi/plugin-upload/admin/src/pages/App/MediaLibrary/components/EmptyOrNoPermissions.js 6:0-65 36:4-15
 @ ./node_modules/@strapi/plugin-upload/admin/src/pages/App/MediaLibrary/index.js 41:0-73 261:4-24
 @ ./node_modules/@strapi/plugin-upload/admin/src/pages/App/index.js 7:0-46 31:498-510
 @ ./node_modules/@strapi/plugin-upload/admin/src/index.js 21:32-24:9
 @ ./node_modules/@strapi/plugin-upload/strapi-admin.js 2:0-47
 @ ./.cache/admin/src/plugins.js 5:0-81 11:12-18
 @ ./.cache/admin/src/index.js 7:0-32 49:16-23

WARNING in ./node_modules/@strapi/plugin-users-permissions/admin/src/pages/Roles/index.js 17:341-349
export 'NotFound' (imported as 'NotFound') was not found in '@strapi/helper-plugin' (possible exports: AnErrorOccurred, AppInfosContext, AutoReloadOverlayBockerContext, CheckPagePermissions, CheckPermissions, ConfirmDialog, ContentBox, ContentManagerEditViewDataManagerContext, CustomFieldsProvider, DateTimePicker, DynamicTable, EmptyBodyTable, EmptyStateLayout, FilterListURLQuery, FilterPopoverURLQuery, Form, GenericInput, GuidedTourProvider, InjectionZone, LibraryProvider, Link, LinkButton, LoadingIndicatorPage, NoContent, NoMedia, NoPermissions, NotAllowedInput, NotificationsContext, NotificationsProvider, OverlayBlockerContext, PageSizeURLQuery, PaginationURLQuery, RBACProviderContext, ReactSelect, RelativeTime, RemoveRoundedButton, SearchURLQuery, SettingsPageTitle, SortIcon, Status, StopPropagation, StrapiAppProvider, TrackingContext, TrackingProvider, auth, contentManagementUtilRemoveFieldsFromData, difference, findMatchingPermissions, formatContentTypeData, getAPIInnerErrors, getFetchClient, getFileExtension, getOtherInfos, getType, getYupInnerErrors, hasPermissions, normalizeAPIError, onRowClick, prefixFileUrlWithBackendUrl, prefixPluginTranslations, pxToRem, request, setHexOpacity, stopPropagation, to, translatedErrors, useAPIErrorHandler, useAppInfos, useAutoReloadOverlayBlocker, useCMEditViewDataManager, useCustomFields, useFetchClient, useFocusWhenNavigate, useGuidedTour, useLibrary, useLockScroll, useNotification, useOverlayBlocker, usePersistentState, useQuery, useQueryParams, useRBAC, useRBACProvider, useSelectionState, useStrapiApp, useTracking, wrapAxiosInstance)
 @ ./node_modules/@strapi/plugin-users-permissions/admin/src/index.js 26:36-29:13
 @ ./node_modules/@strapi/plugin-users-permissions/strapi-admin.js 2:0-47
 @ ./.cache/admin/src/plugins.js 6:0-102 12:23-39
 @ ./.cache/admin/src/index.js 7:0-32 49:16-23

webpack 5.77.0 compiled with 5 warnings in 6400 ms
No errors found.

Steps to reproduce the behavior

  1. Create a new strapi project yarn create strapi-app my-project
  2. Choose Quickstart (recommended)
  3. Kill the process after everything has installed and started
  4. Run yarn develop --watch-admin

Expected behavior

Strapi should start without throwing errors.

tult98 commented 1 year ago

I faced the same issue

iamandrewluca commented 1 year ago

Same 🤔

WARNING in ./node_modules/@strapi/plugin-content-type-builder/admin/src/components/AttributeOptions/EmptyAttributes/index.js 27:387-405
export 'EmptyStateDocument' (imported as 'EmptyStateDocument') was not found in '@strapi/icons'

WARNING in ./node_modules/@strapi/plugin-upload/admin/src/components/EmptyAssets/index.js 7:508-527
export 'EmptyStateDocuments' (imported as 'EmptyStateDocuments') was not found in '@strapi/icons'

WARNING in ./node_modules/@strapi/plugin-users-permissions/admin/src/pages/Roles/index.js 17:341-349
export 'NotFound' (imported as 'NotFound') was not found in '@strapi/helper-plugin'

WARNING in ./node_modules/strapi-plugin-import-export-entries/admin/src/pages/App/index.js 7:276-284
export 'NotFound' (imported as 'NotFound') was not found in '@strapi/helper-plugin'
ingowonner commented 1 year ago

There is actually an open PR which seems to fix this issue: https://github.com/strapi/strapi/pull/16252

For our project i created some patches which are working with patch-package. This solves the issue until there is a proper fix from strapi: https://gist.github.com/ingowonner/6b59af2aaa5d2df9fbaead8c4e95bb0e

iamandrewluca commented 1 year ago

@ingowonner thanks for the patch 🙌🏼

joshuaellis commented 1 year ago

@markkaylor do you think you could cherry pick your commit from #16252 as a separate PR to solve this issue quicker? :)

markkaylor commented 1 year ago

@joshuaellis I'm still working on the issue right now but yes I could cherry pick the commit to a new PR.

strapi-bot commented 1 year ago

This issue has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/strapi-watch-admin-doesnt-wor-on-nodes-modules-update/27656/4

jensborje commented 1 year ago

I'm also experiencing this or similar issue while running 4.10.5 with yarn PnP enabled.

After reporting a wall of errors, it prints

webpack 5.83.1 compiled with 516 errors in 887 ms

The errors seems to be the same, but for different peer dependency modules not being found. Here's an example:

ERROR in ./.yarn/__virtual__/@uiw-react-codemirror-virtual-170db3fe60/0/cache/@uiw-react-codemirror-npm-4.20.2-bac86c09c1-e0f448ab30.zip/node_modules/@uiw/react-codemirror/esm/getDefaultExtensions.js 3:0-67
Module not found: Error: @uiw/react-codemirror tried to access @codemirror/view (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.

Required package: @codemirror/view
Required by: @uiw/react-codemirror@virtual:c93499b2a0d813975ac3aeacda90d3384bf48f89f08983e66fa58f14775e001b9170f0051654bccea43b55841108978d56594926d8605977cdad835ea024df3d#npm:4.20.2 (via /Users/[LOCAL PATH]/.yarn/__virtual__/@uiw-react-codemirror-virtual-170db3fe60/0/cache/@uiw-react-codemirror-npm-4.20.2-bac86c09c1-e0f448ab30.zip/node_modules/@uiw/react-codemirror/esm/)

Ancestor breaking the chain: @strapi/design-system@virtual:4b677b9b50849321bce688ab5d8e1399d4d43bb4e1331cf8d8b8232701556ebef284a21f85d407b4f0f40aad19c0648106f1165ccd11b9ab09583e3440fe7e3a#npm:1.7.5

 @ ./.yarn/__virtual__/@uiw-react-codemirror-virtual-170db3fe60/0/cache/@uiw-react-codemirror-npm-4.20.2-bac86c09c1-e0f448ab30.zip/node_modules/@uiw/react-codemirror/esm/index.js 9:0-39 9:0-39
 @ ./.yarn/__virtual__/@strapi-design-system-virtual-c93499b2a0/0/cache/@strapi-design-system-npm-1.7.5-27ff311d29-33f5029039.zip/node_modules/@strapi/design-system/dist/JSONInput/JSONInput.js 4:0-59 37:27-28
 @ ./.yarn/__virtual__/@strapi-design-system-virtual-c93499b2a0/0/cache/@strapi-design-system-npm-1.7.5-27ff311d29-33f5029039.zip/node_modules/@strapi/design-system/dist/index.js 55:0-59 140:0-306:2
 @ ./.cache/admin/src/StrapiApp.js 5:0-62 37:23-33 37:41-50
 @ ./.cache/admin/src/index.js 45:26-48:3
Canoir commented 6 months ago

1+