export 'default' (imported as 'payload') was not found in 'payload' (possible exports: __esModule...

default discord avatar
jakehopking
last month
3

Hi team



I'm excited to try payload 2.0, and up to this point I've been impressed with the smoothness of the migration (after working through all of the breaking changes).



Well done on this major release @payloadcms team!



I have this odd console warning (repeated 8 times):



yarn run v1.22.19
$ cross-env NODE_ENV=development PAYLOAD_CONFIG_PATH=src/payload.config.ts ts-node src/dev.ts
[19:49:16] INFO (payload): Connected to MongoDB server successfully!
[19:49:16] INFO (payload): Starting Payload...
[19:49:17] INFO (payload): Payload Admin URL: http://10.0.1.236:3000/admin
Server listening on 3000...
webpack built 7bec152730d945df1212 in 9799ms
WARNING in ./src/lib/payload.ts 226:16-28
export 'default' (imported as 'payload') was not found in 'payload' (possible exports: __esModule, webpackBundler)
...
WARNING repeated eight times
...

webpack compiled with 8 warnings


The imports for my file

payload.ts

looks like this:



import payload from 'payload';
import { PaginatedDocs } from 'payload/database';
import type Stripe from 'stripe';

import { RelatedType } from '../blocks/Related';
import { CollectionType } from '../collections/Collection.type';
import { EssayType } from '../collections/Essay.type';
import { Layout, PageType } from '../collections/Page.type';
import { JournalType } from '../collections/Journal.type';
import {
  PrintProductType,
  RelatedCollectionItem,
} from '../collections/Product.type';
import { shuffleArray } from '../utilities/arrays';
import { CartProductType } from '../stores/useCart';
import {
  queryPublished,
  queryByCategoriesAndTags,
  queryPublishedAndPublishedAtNow,
} from './queries';
import { unpackRCBlocks } from './utils';
import { CollectionSlugs } from '../tokens/core';
import { Customer, Order, Product } from '../payload-types';

export const ...


Any ideas?



It doesn't break the dev server nor the prod build, so nothing urgent but would be nice to have a clean console so I can relax.

  • discord user avatar
    denolfe
    Payload Team
    last month

    That's awesome to hear @jakehopking !



    We've already received reports of this issue, and it's being tracked here 👍



    https://github.com/payloadcms/payload/issues/3494
  • default discord avatar
    jakehopking
    last month

    Thanks, will keep em eye on the linked issue 👍

  • discord user avatar
    denolfe
    Payload Team
    last month

    Issue resolved in 2.0.11 ✅

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.