lumeland / lume

🔥 Static site generator for Deno 🦕
https://lume.land
MIT License
1.86k stars 85 forks source link

Error The deployment failed: Module not found "npm:markdown-it-attrs@4.1.3". #319

Closed willem-haring closed 1 year ago

willem-haring commented 1 year ago

Version

https://deno.land/x/lume@v1.13.0/

Platform

deno deploy

What steps will reproduce the bug?

first deployment worked. Second deployment failed with: Error The deployment failed: Module not found "npm:markdown-it-attrs@4.1.3".

Log: Cloning repository (100%) Downloaded file:///src/serve.ts Downloaded https://deno.land/x/lume@v1.13.0/core/server.ts Downloaded https://deno.land/x/lume@v1.13.0/middlewares/on_demand.ts Downloaded file:///src/_config.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/http.ts Downloaded https://deno.land/x/lume@v1.13.0/core/events.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/path.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/postcss.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/media_types.ts Downloaded https://deno.land/x/lume@v1.13.0/mod.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/base_path.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/on_demand.ts Downloaded https://deno.land/std@0.164.0/http/server.ts Downloaded https://deno.land/std@0.164.0/path/mod.ts Downloaded https://deno.land/std@0.164.0/http/file_server.ts Downloaded https://deno.land/x/lume@v1.13.0/core/filesystem.ts Downloaded https://deno.land/std@0.164.0/media_types/mod.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/postcss.ts Downloaded npm:autoprefixer@10.4.13 Downloaded npm:postcss-import@15.0.0 Downloaded npm:postcss-nesting@10.0.2 Downloaded npm:postcss@8.4.18 Downloaded https://deno.land/x/lume@v1.13.0/core/utils.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/source_maps.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/yaml.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/flags.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/json.ts Downloaded https://deno.land/x/lume@v1.13.0/core/site.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/markdown.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/modules.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/nunjucks.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/paginate.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/url.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/search.ts Downloaded https://deno.land/x/lume@v1.13.0/plugins/modify_urls.ts Downloaded https://deno.land/std@0.164.0/async/mod.ts Downloaded https://deno.land/std@0.164.0/_util/os.ts Downloaded https://deno.land/std@0.164.0/path/_interface.ts Downloaded https://deno.land/std@0.164.0/path/common.ts Downloaded https://deno.land/std@0.164.0/path/glob.ts Downloaded https://deno.land/std@0.164.0/path/win32.ts Downloaded https://deno.land/std@0.164.0/path/separator.ts Downloaded https://deno.land/std@0.164.0/path/posix.ts Downloaded https://deno.land/std@0.164.0/http/util.ts Downloaded https://deno.land/std@0.164.0/_util/asserts.ts Downloaded https://deno.land/std@0.164.0/crypto/_util.ts Downloaded https://deno.land/std@0.164.0/crypto/mod.ts Downloaded https://deno.land/std@0.164.0/fmt/colors.ts Downloaded https://deno.land/std@0.164.0/flags/mod.ts Downloaded https://deno.land/std@0.164.0/version.ts Downloaded https://deno.land/std@0.164.0/http/http_status.ts Downloaded https://deno.land/std@0.164.0/media_types/_util.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/jsonc.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/colors.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/base64.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/dom.ts Downloaded https://deno.land/x/lume@v1.13.0/core/loaders/json.ts Downloaded https://deno.land/x/lume@v1.13.0/core/loaders/yaml.ts Downloaded https://deno.land/x/lume@v1.13.0/core/writer.ts Downloaded https://deno.land/x/lume@v1.13.0/core/component_loader.ts Downloaded https://deno.land/x/lume@v1.13.0/core/data_loader.ts Downloaded https://deno.land/x/lume@v1.13.0/core/errors.ts Downloaded https://deno.land/x/lume@v1.13.0/core/formats.ts Downloaded https://deno.land/x/lume@v1.13.0/core/includes_loader.ts Downloaded https://deno.land/x/lume@v1.13.0/core/logger.ts Downloaded https://deno.land/x/lume@v1.13.0/core/loaders/text.ts Downloaded https://deno.land/x/lume@v1.13.0/core/page_loader.ts Downloaded https://deno.land/x/lume@v1.13.0/core/page_preparer.ts Downloaded https://deno.land/x/lume@v1.13.0/core/processors.ts Downloaded https://deno.land/x/lume@v1.13.0/core/reader.ts Downloaded https://deno.land/x/lume@v1.13.0/core/scopes.ts Downloaded https://deno.land/x/lume@v1.13.0/core/renderer.ts Downloaded https://deno.land/std@0.164.0/media_types/vendor/mime-db.v1.52.0.ts Downloaded https://deno.land/x/lume@v1.13.0/core/scripts.ts Downloaded https://deno.land/x/lume@v1.13.0/core/loaders/module.ts Downloaded https://deno.land/x/lume@v1.13.0/core/source.ts Downloaded https://deno.land/std@0.164.0/path/_constants.ts Downloaded https://deno.land/std@0.164.0/crypto/_wasm/mod.ts Downloaded https://deno.land/std@0.164.0/crypto/keystack.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/markdown_it.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/nunjucks.ts Downloaded https://deno.land/x/lume@v1.13.0/core.ts Downloaded https://deno.land/std@0.164.0/async/tee.ts Downloaded https://deno.land/std@0.164.0/async/abortable.ts Downloaded https://deno.land/std@0.164.0/async/deadline.ts Downloaded https://deno.land/std@0.164.0/async/debounce.ts Downloaded https://deno.land/std@0.164.0/async/deferred.ts Downloaded https://deno.land/std@0.164.0/async/delay.ts Downloaded https://deno.land/std@0.164.0/async/mux_async_iterator.ts Downloaded https://deno.land/std@0.164.0/async/pool.ts Downloaded https://deno.land/std@0.164.0/path/_util.ts Downloaded https://deno.land/std@0.164.0/crypto/util.ts Downloaded https://deno.land/std@0.164.0/crypto/_fnv/index.ts Downloaded npm:markdown-it-attrs@4.1.3 Downloaded npm:markdown-it-deflist@2.1.0 Downloaded npm:markdown-it@13.0.0 Downloaded https://deno.land/std@0.164.0/collections/deep_merge.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/yaml.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/fs.ts Downloaded https://deno.land/std@0.164.0/crypto/timing_safe_equal.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/deno-dom-wasm.ts Downloaded https://deno.land/std@0.164.0/encoding/base64.ts Downloaded https://deno.land/std@0.164.0/encoding/jsonc.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/front_matter.ts Downloaded https://deno.land/x/lume@v1.13.0/deps/date.ts Downloaded https://deno.land/std@0.164.0/crypto/_fnv/fnv64.ts Downloaded https://deno.land/x/nunjucks@3.2.3-2/mod.js Downloaded https://deno.land/std@0.164.0/encoding/base64url.ts Downloaded https://deno.land/std@0.164.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.mjs Downloaded https://deno.land/std@0.164.0/encoding/hex.ts Downloaded https://deno.land/std@0.164.0/crypto/_fnv/fnv32.ts Downloaded https://deno.land/std@0.164.0/collections/_utils.ts Downloaded https://deno.land/std@0.164.0/encoding/front_matter/yaml.ts Downloaded https://deno.land/std@0.164.0/encoding/yaml.ts Downloaded https://deno.land/std@0.164.0/fs/mod.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/parser.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/api.ts Downloaded https://deno.land/x/date_fns@v2.22.1/format/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/parseISO/index.js Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/build/deno-wasm/deno-wasm.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/runtime.js Downloaded https://deno.land/std@0.164.0/crypto/_fnv/util.ts Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/environment.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/compiler.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/lexer.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/jinja_compat.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/lib.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/loader.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/nodes.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/loaders.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/precompile.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/parser.js Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type.ts Downloaded https://deno.land/std@0.164.0/encoding/front_matter/mod.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/schema/mod.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/parse.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/stringify.ts Downloaded https://deno.land/std@0.164.0/fs/walk.ts Downloaded https://deno.land/std@0.164.0/fs/empty_dir.ts Downloaded https://deno.land/std@0.164.0/fs/copy.ts Downloaded https://deno.land/std@0.164.0/fs/ensure_dir.ts Downloaded https://deno.land/std@0.164.0/fs/ensure_file.ts Downloaded https://deno.land/std@0.164.0/fs/ensure_symlink.ts Downloaded https://deno.land/std@0.164.0/fs/ensure_link.ts Downloaded https://deno.land/std@0.164.0/fs/exists.ts Downloaded https://deno.land/std@0.164.0/fs/eol.ts Downloaded https://deno.land/std@0.164.0/fs/move.ts Downloaded https://deno.land/std@0.164.0/fs/expand_glob.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/deserialize.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/selectors/selectors.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/document-fragment.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/document.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/dom-parser.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/element.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/elements/html-template-element.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/html-collection.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/node-list.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/node.ts Downloaded https://deno.land/x/date_fns@v2.22.1/toDate/index.ts Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/format/formatters/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/getTimezoneOffsetInMilliseconds/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/format/longFormatters/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/protectedTokens/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/requiredArgs/index.ts Downloaded https://deno.land/x/date_fns@v2.22.1/isValid/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/toInteger/index.ts Downloaded https://deno.land/x/date_fns@v2.22.1/locale/en-US/index.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/transformer.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/express_app.js Downloaded https://deno.land/x/date_fns@v2.22.1/subMilliseconds/index.ts Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/globals.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/filters.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/tests.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/object.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/precompile_global.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/waterfall.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/deps.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/node_loaders.js Downloaded https://deno.land/std@0.164.0/encoding/_yaml/schema/core.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/schema/extended.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/schema/default.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/schema/json.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/schema/failsafe.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/loader/loader.ts Downloaded https://deno.land/std@0.164.0/fs/_util.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/selectors/sizzle-types.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/constructor-lock.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/dumper/dumper.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/selectors/nwsapi-types.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/utils.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/utils-types.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/selectors/custom-api.ts Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/getUTCDayOfYear/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/format/lightFormatters/index.ts Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/getUTCWeek/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/getUTCISOWeek/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/getUTCISOWeekYear/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/getUTCWeekYear/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/addMilliseconds/index.ts Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/addLeadingZeros/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/en-US/_lib/formatDistance/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/en-US/_lib/formatLong/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/en-US/_lib/formatRelative/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/en-US/_lib/localize/index.js Downloaded https://deno.land/x/nunjucks@3.2.3-2/src/precompiled_loader.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/en-US/_lib/match/index.js Downloaded https://deno.land/x/events@v1.0.0/mod.ts Downloaded https://deno.land/std@0.161.0/path/mod.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/mod.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/schema.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/error.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/loader/loader_state.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/mark.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/utils.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/dumper/dumper_state.ts Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/selectors/sizzle.js Downloaded https://deno.land/x/deno_dom@v0.1.35-alpha/src/dom/selectors/nwsapi.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/startOfUTCWeekYear/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/startOfUTCISOWeekYear/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/startOfUTCWeek/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/_lib/buildLocalizeFn/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/_lib/startOfUTCISOWeek/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/_lib/buildMatchPatternFn/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/_lib/buildFormatLongFn/index.js Downloaded https://deno.land/x/date_fns@v2.22.1/locale/_lib/buildMatchFn/index.js Downloaded https://deno.land/std@0.161.0/_util/os.ts Downloaded https://deno.land/std@0.161.0/path/_interface.ts Downloaded https://deno.land/std@0.161.0/path/win32.ts Downloaded https://deno.land/std@0.161.0/path/common.ts Downloaded https://deno.land/std@0.161.0/path/glob.ts Downloaded https://deno.land/std@0.161.0/path/separator.ts Downloaded https://deno.land/std@0.161.0/path/posix.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/undefined.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/binary.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/float.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/bool.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/int.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/function.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/map.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/merge.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/nil.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/pairs.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/omap.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/regexp.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/seq.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/str.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/set.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/type/timestamp.ts Downloaded https://deno.land/std@0.161.0/path/_util.ts Downloaded https://deno.land/std@0.164.0/encoding/_yaml/state.ts Downloaded https://deno.land/std@0.161.0/_util/assert.ts Downloaded https://deno.land/std@0.161.0/path/_constants.ts Downloaded https://deno.land/std@0.164.0/io/buffer.ts Downloaded https://deno.land/std@0.164.0/bytes/mod.ts Downloaded https://deno.land/std@0.164.0/bytes/bytes_list.ts Downloaded https://deno.land/std@0.164.0/bytes/equals.ts Error The deployment failed: Module not found "npm:markdown-it-attrs@4.1.3".

How often does it reproduce? Is there a required condition?

Every deployment after the furst

What is the expected behavior?

No response

What do you see instead?

the error as in the log

Additional information

No response

oscarotero commented 1 year ago

Deno deploy doesn't support npm imports. Why do you want to run Lume in Deno Deploy? The recomended way to deploy static sites to Deno Deploy is by using the GitHub Actions. More info here: https://lume.land/docs/advanced/deployment/#deno-deploy

willem-haring commented 1 year ago

That is exacly how i started, and the github action throws the exact same error.. That was my reason to roll with deno deploy, so i could capture the complete log output.

The strange thing is, is that my initial deployment worked fine....

My reason for deploying is to better understand the on_demand plugin...

My working deployment: https://willem-haring-lume.deno.dev/

image
oscarotero commented 1 year ago

Ok, understood. The on_demand plugin doesn't work in Deno Deploy because Lume now uses npm: imports which aren't supported yet in Deno Deploy. I guess it's matter of time they implement this (issue: https://github.com/denoland/deploy_feedback/issues/314).

Meanwhile, you can use the version 1.11.x (the last version without npm imports) that should work fine). You have a test here: https://github.com/lumeland/test-lume-ondemand

willem-haring commented 1 year ago

Thanks for the feedback, will close this issue then, but might be use-full for others.

Keep up the good work!

oscarotero commented 1 year ago

@willem-haring I just discover that this could be fixed from the import_map.json file. For example:

{
  "imports": {
    "lume/": "https://deno.land/x/lume@v1.13.0/",
    "npm:markdown-it@13.0.0": "https://esm.sh/markdown-it@13.0.0",
    "npm:markdown-it-attrs@4.1.3": "https://esm.sh/markdown-it-attrs@4.1.3",
    "npm:markdown-it-deflist@2.1.0": "https://esm.sh/markdown-it-deflist@2.1.0"
  }
}

Just need to find all npm modules loaded and redirect to esm.sh.