Git Product home page Git Product logo

Comments (10)

tipiirai avatar tipiirai commented on May 25, 2024 1

Indeed. I pushed a new nuemark version. Should work now.

Thank you @Pirosauro and everyone on this thread! npm is no joke.

from nue.

nobkd avatar nobkd commented on May 25, 2024

@tipiirai did you change something, that can explain this?

I did:

  • bun install --global nuekit
  • bun create nue@latest -> template simple-blog
  • cd testapp
  • nue

and get the similar following log, but I can still open the webpage without problems, other than the person above

show log
✓ Nue 0.4.2 • Bun 1.0.29 
✓ Initialize ./.dist/dev: 105 |   if (format !== 'module') return
106 |   const urlPath = fileURLToPath(url.href)
107 |   const pkgPath = fileURLToPath(new URL('.', packageJsonUrl))
108 |   const basePath = fileURLToPath(base)
109 |   if (!main) {
110 |     process.emitWarning(
          ^
warn: No "main" or "exports" field defined in the package.json for /home/user/.bun/install/global/node_modules/nuemark/ resolving the main entry point "index.js", imported from /home/user/.bun/install/global/node_modules/nuekit/src/.
Default "index" lookups for the main are deprecated for ES modules.
      at emitLegacyIndexDeprecation (/home/user/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:110:5)
      at legacyMainResolve (/home/user/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:212:5)
      at moduleResolve (/home/user/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:1101:20)
      at defaultResolve (/home/user/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:1266:15)
      at resolve (/home/user/.bun/install/global/node_modules/import-meta-resolve/index.js:32:12)
      at /home/user/.bun/install/global/node_modules/nuekit/src/init.js:95:20
      at resolvePath (/home/user/.bun/install/global/node_modules/nuekit/src/init.js:93:28)
      at /home/user/.bun/install/global/node_modules/nuekit/src/init.js:60:19
      at buildPackage (/home/user/.bun/install/global/node_modules/nuekit/src/init.js:57:31)

••••••••••✓ Serving site from ./.dist/dev
✓ Building site to: ./.dist/dev

✓ Processing styles 5
   posts/post.css
   posts/syntax.css
   global/global.css
   global/feedback.css
   home.css

✓ Transpiling components 1
   global/feedback.nue

✓ Generating pages 4
   posts/color-strategies.md
   posts/scaleable-design-system.md
   posts/class-naming-strategies.md
   index.md

✓ Copying static files 21
   posts/img/dashboard-3.png
   posts/img/colors-1.png
   posts/img/dashboard-2.png
   posts/img/colors-3.png
   posts/img/ui-3.png
   posts/img/ui-1.png
   posts/img/ui-2.png
   posts/img/colors-2.jpg
   posts/img/dashboard-1.png
   img/email.svg
   img/controls.svg
   img/favicon.png
   img/twitter.svg
   img/favicon.jpg
   img/og.jpg
   img/avatar.jpg
   img/linkedin.svg
   img/profile.jpg
   img/sparkles.svg
   img/feedback.svg
   img/github.svg

Time taken: 586ms

✓ http://localhost:8080/

Maybe the error has to do with: b08fff5#diff-af3f6e87ca420033f10d1e6e6cb3cbdfbf3d280c57f54407c5ebf00f356c94b5
But I don't quite understand why...

Also, it seems as if not all resources are copied for the person above.

As I have no problems viewing the page, these are possibly two separate issues

from nue.

tipiirai avatar tipiirai commented on May 25, 2024

@nobkd the error indeed relates to the "main": "index.js" property, which actually fixed the above error for me. Do you have that line on nuemark's package.json? Do you get the same error when you run nue the second time?

from nue.

Neitralov avatar Neitralov commented on May 25, 2024

I'm surprised I didn't do this sooner, but I cleared my browser cache and now the webpage opens and works as it should.

However, the error warn: No "main" or "exports" field defined in the package.json... still appears in the logs the first time I build any Nue project now.

I'll change the name of this issue for correctness

from nue.

tipiirai avatar tipiirai commented on May 25, 2024

Can you paste the contents of your /home/user/.bun/install/global/node_modules/nuemark/package.json here? Thanks!

from nue.

Neitralov avatar Neitralov commented on May 25, 2024
{
  "name": "nuemark",
  "version": "0.2.1",
  "description": "Markdown dialect for rich, interactive web content",
  "homepage": "https://nuejs.org",
  "license": "MIT",
  "type": "module",
  "repository": {
    "url": "https://github.com/nuejs/nue",
    "directory": "packages/nuemark",
    "type": "git"
  },

  "dependencies": {
    "nue-glow": "^0.1.0",
    "js-yaml": "^4.1.0",
    "marked": "^9.1.2"
  }
}

from nue.

tipiirai avatar tipiirai commented on May 25, 2024

Thanks! The issue should now be fixed after re-installing nuekit:

bun install nuekit --global

from nue.

Neitralov avatar Neitralov commented on May 25, 2024

I reinstalled it, but

My logs
✓ Nue 0.4.3 • Bun 1.0.29 
✓ Initialize ./.dist/dev: 105 |   if (format !== 'module') return
106 |   const urlPath = fileURLToPath(url.href)
107 |   const pkgPath = fileURLToPath(new URL('.', packageJsonUrl))
108 |   const basePath = fileURLToPath(base)
109 |   if (!main) {
110 |     process.emitWarning(
          ^
warn: No "main" or "exports" field defined in the package.json for /home/maxim/.bun/install/global/node_modules/nuemark/ resolving the main entry point "index.js", imported from /home/maxim/.bun/install/global/node_modules/nuekit/src/.
Default "index" lookups for the main are deprecated for ES modules.
      at emitLegacyIndexDeprecation (/home/maxim/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:110:5)
      at legacyMainResolve (/home/maxim/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:212:5)
      at moduleResolve (/home/maxim/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:1101:20)
      at defaultResolve (/home/maxim/.bun/install/global/node_modules/import-meta-resolve/lib/resolve.js:1266:15)
      at resolve (/home/maxim/.bun/install/global/node_modules/import-meta-resolve/index.js:32:12)
      at /home/maxim/.bun/install/global/node_modules/nuekit/src/init.js:95:20
      at resolvePath (/home/maxim/.bun/install/global/node_modules/nuekit/src/init.js:93:28)
      at /home/maxim/.bun/install/global/node_modules/nuekit/src/init.js:60:19
      at buildPackage (/home/maxim/.bun/install/global/node_modules/nuekit/src/init.js:57:31)

••••••••••✓ Serving site from ./.dist/dev
✓ Building site to: ./.dist/dev

✓ Processing styles 4
   style/navigation.css
   style/table.css
   style/global.css
   style/analytics.css

✓ Building scripts 1
   model/index.ts

✓ Transpiling components 3
   analytics.nue
   app.nue
   users.nue

✓ Copying static files 4
   model/users.json
   model/analytics.json
   model/feedback.json
   img/nue-logo.svg

✓ Single-page apps 1
   index.html

Time taken: 13ms

✓ http://localhost:8080/

That "warn" log still exists. Is there anything I should do myself besides reinstalling?

from nue.

Pirosauro avatar Pirosauro commented on May 25, 2024

Same here.
Adding the main entry point to Nuemark package.json makes the deprecation warning disappear.

See https://nodejs.org/api/deprecations.html#DEP0151

However, seems you need to bump Neumark version and publish it @tipiirai. The latest version in the registry is still have the issue. See https://www.npmjs.com/package/nuemark?activeTab=code

from nue.

nobkd avatar nobkd commented on May 25, 2024

I‘ll close this, as the fix should be out. Feel free to comment/reopen, if the error still occurs.

from nue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.