Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed recommendation to use .mjs in readme.md #563

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jt3k
Copy link

@jt3k jt3k commented Apr 29, 2021

Because with wmr.config.mjs now results SyntaxError: Cannot use import statement outside a module

❯ mv ./wmr.config.mjs ./wmr.config.js

❯ npm run build

> @ build /Users/jt3k/work/sigma-aa/active-age/creditpotential
> wmr build --prerender

(node:49904) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
/Users/jt3k/work/sigma-aa/active-age/creditpotential/wmr.config.js:1
import nomodule from '@wmrjs/nomodule';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:979:16)
    at Module._compile (internal/modules/cjs/loader.js:1027:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at ModuleWrap.<anonymous> (internal/modules/esm/translators.js:199:29)
    at ModuleJob.run (internal/modules/esm/module_job.js:152:23)
    at async Loader.import (internal/modules/esm/loader.js:166:24)
    at async kJe (/Users/jt3k/work/sigma-aa/active-age/creditpotential/node_modules/wmr/wmr.cjs:2:2446119)
    at async PJe (/Users/jt3k/work/sigma-aa/active-age/creditpotential/node_modules/wmr/wmr.cjs:2:2447457)

Failed to load wmr.config.js
SyntaxError: Cannot use import statement outside a module
TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received an instance of URL
    at kJe (/Users/jt3k/work/sigma-aa/active-age/creditpotential/node_modules/wmr/wmr.cjs:2:2446268)
    at async PJe (/Users/jt3k/work/sigma-aa/active-age/creditpotential/node_modules/wmr/wmr.cjs:2:2447457)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: `wmr build --prerender`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/jt3k/.npm/_logs/2021-04-29T10_10_41_649Z-debug.log

Because with `wmr.config.mjs` now results `SyntaxError: Cannot use import statement outside a module`
@changeset-bot
Copy link

changeset-bot bot commented Apr 29, 2021

⚠️ No Changeset found

Latest commit: 68a1697

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@developit
Copy link
Member

Hmm - doesn't the readme say that using wmr.config.js requires setting {"type":"module"} in your package.json? npm init wmr should also set that property correctly.

@rschristian
Copy link
Member

The new project template does not set the module type at the moment, no.

@developit
Copy link
Member

oh! we should change that - without "type":"module" I think prerendering breaks on Node 12.12 or something like that.

@rschristian
Copy link
Member

#546 upped the engine req to 12.17.x. Is an issue on < 12.17 be something we'd be concerned with?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants