prismicio / slice-simulator

Preview and develop Prismic slices fast with minimal configuration
6 stars 5 forks source link

Type error: Cannot access ambient const enums when the '--isolatedModules' flag is provided. #10

Closed jeremytenjo closed 2 years ago

jeremytenjo commented 2 years ago

Versions

"@prismicio/client": "6.6.1",
"@prismicio/helpers": "2.3.1",
"@prismicio/next": "0.1.3",
"@prismicio/react": "2.4.2",

Reproduction

Steps to reproduce

  1. run git clone https://github.com/jeremytenjo/prismic-enum-error.git && cd prismic-enum-error && npm i && npm run build

What is expected?

Build successfully

What is actually happening?

Returns error:

./node_modules/@prismicio/slice-simulator-core/dist/index.d.ts:143:159
Type error: Cannot access ambient const enums when the '--isolatedModules' flag is provided.

  141 | declare const sliceSimulatorAccessedDirectly: string;
  142 | 
> 143 | export { CoreManager, ManagedState, SliceSimulatorOptions, SliceSimulatorProps, SliceSimulatorState, StateManager, StateManagerEventType, StateManagerEvents, StateManagerStatus, disableEventHandler, getActiveSliceDOM, getDefaultManagedState, getDefaultMessage, getDefaultProps, getDefaultSlices, getSliceZoneDOM, onClickHandler, simulatorClass, simulatorRootClass, sliceSimulatorAccessedDirectly };
      |                                                                                                                                                               ^
  144 | 

--isolatedModules has to remain as true because Nextjs depends on it to work.

github-actions[bot] commented 2 years ago

This issue has been labeled as a bug since it was created using the 🚨 Bug Report Template.

Hi there, thank you so much for the report!

Following our Maintenance Process, we will review your bug report and get back to you next Wednesday. To ensure a smooth review of your issue and avoid unnecessary delays, please make sure your issue includes the following:

If you have identified the cause of the bug described in your report and know how to fix it, you're more than welcome to open a pull request addressing it. Check out our quick start guide for a simple contribution process.

If you think your issue is a question (not a bug) and would like quicker support, please close this issue and forward it to an appropriate section on our community forum: https://community.prismic.io

- The Prismic Open-Source Team