lonnieezell / forum-example

An in-progress sample forum application built on CodeIgniter 4.
MIT License
43 stars 10 forks source link

Bug: build failed #34

Closed datamweb closed 1 year ago

datamweb commented 1 year ago

Starting from #31

Server running at http://localhost:1234
🚨 Build failed.

@parcel/core: Failed to resolve 'easymde' from './themes/default/js/components/markdownEditor.js'

  P:\ci4\pr31\themes\default\js\components\markdownEditor.js:4:21
    3 |
  > 4 | import EasyMDE from "easymde";
  >   |                     ^^^^^^^^^
    5 |
    6 | export function initEditor(elem) {
michalsn commented 1 year ago

Hmm... I just removed node_modules and ran:

npm install

and then

npm run dev

No errors. Not sure how to reproduce.

datamweb commented 1 year ago

The new installation is OK. I did not understand the reason!

P:\ci4\PR31-2>npm run dev

> myth-forums@1.0.0-dev dev
> parcel themes/default/css/app.scss themes/default/js/app.js --dist-dir ./public

Port "1234" could not be used
Server running at http://localhost:1975
| Building app.scss...

🌼 daisyUI components 2.52.0  https://daisyui.com
  ✔︎ Including:  base, components, 29 themes, utilities
Server running at http://localhost:1975
- Building app.scss...
michalsn commented 1 year ago

The contents of the package.json file have changed. Maybe you didn't run npm install?

datamweb commented 1 year ago

Maybe you didn't run npm install?

I have run it after your comment. However, the problem was not resolved. I reinstalled and everything seems fine. I'm closing now.

datamweb commented 1 year ago

Hmmm, I changed file package.json to this:

{
}

Then I executed command npm install.

I filled the file again with this:

{
  "name": "myth-forums",
  "version": "1.0.0-dev",
  "browserslist": "> 0.5%, last 2 versions, not dead",
  "engines": {
    "node": ">= 18"
  },
  "source": "src/index.js",
  "main": "dist/main.js",
  "dependencies": {
    "alpinejs": "^3.13.0",
    "daisyui": "^2.52.0",
    "easymde": "^2.18.0",
    "htmx.org": "^1.9.5"
  },
  "devDependencies": {
    "@parcel/transformer-sass": "^2.9.3",
    "@tailwindcss/typography": "^0.5.9",
    "parcel": "^2.9.3",
    "postcss": "^8.4.29",
    "prettier": "^2.8.8",
    "prettier-plugin-tailwindcss": "^0.2.8",
    "tailwindcss": "^3.3.3"
  },
  "scripts": {
    "dev": "parcel themes/default/css/app.scss themes/default/js/app.js --dist-dir ./public"
  }
}

and run npm install.

It works now.