Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

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

default discord avatar
jakehopkinglast year
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

@967091941873426493

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.

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.