GrapesJS / preset-newsletter

GrapesJS preset configuration for the newsletter editor.
https://grapesjs.com/demo-newsletter-editor.html
BSD 3-Clause "New" or "Revised" License
189 stars 143 forks source link

Error for installing and running build #138

Open atoyansk opened 8 months ago

atoyansk commented 8 months ago

I'm trying to update to the new versions of the plugin in Angular 14 project, specifically versions 1.0.2 and 1.0.1, but in both I can't use npm run build dev.

I cloned the project, installed the package and then ran npm i to install the dependencies, and everything seems fine. However, when running npm run build dev, it displays the error below (in the case of version 1.0.1):

npm run build dev

> grapesjs-preset-newsletter@1.0.1 build
> grapesjs-cli build dev

Start building the library...

assets by status 803 bytes [cached] 1 asset

ERROR in ./src/index.ts 6:12
Module parse failed: Unexpected token (6:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import loadPanels from './panels';
| import loadStyles from './styles';
> import type grapesjs from 'grapesjs';
| 
| export interface PluginOptions {

webpack 5.75.0 compiled with 1 error in 206 ms

Start building TS declaration file...

TS declaration file building completed successfully!

Error during building

Trying the version 1.0.2:

npm run build

> grapesjs-preset-newsletter@1.0.2 build
> grapesjs-cli build

Start building the library...

assets by status 757 bytes [cached] 1 asset

ERROR in ./src/index.ts 1:12
Module parse failed: Unexpected token (1:12)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
> import type { Plugin } from 'grapesjs';
| import juice from 'juice';
| import loadBlocks from './blocks';

webpack 5.86.0 compiled with 1 error in 210 ms

Start building TS declaration file...

TS declaration file building completed successfully!

Error during building

null

For version 1.0.2, it didn't work npm run build dev, only npm run build

"grapesjs": "^0.21.8" "grapesjs-preset-newsletter": "^1.0.1" OR "^1.0.2" "@angular/core": "^14.0.0"