Skip to content

Getting Module not found: Error: Can't resolve 'velocityjs' with webpack #10020

@Mister-Hope

Description

@Mister-Hope

Vue version

3.4.5

Link to minimal reproduction

https://github.com/vuepress-theme-hope/vuepress-theme-hope/actions/runs/7431497360/job/20222349242#step:7:174

The only notable change of this pr is bumping vue from 3.4.3 to 3.4.5

Steps to reproduce

Upgrading a esm based project with vue

What is expected?

No error.

I believe this is caused by #9977

The original file I used should be the esm one before this pr, and does have any codes that import 'velocityjs', while the cjs one has the following lines:


	/**
	 * velocity support.
	 */

	exports.velocityjs = fromStringRenderer('velocityjs');

	/**
	 * velocity string support.
	 */

	exports.velocityjs.render = function(str, options, cb) {
	  return promisify(cb, function(cb) {
	    var engine = requires.velocityjs || (requires.velocityjs = require('velocityjs'));
	    try {
	      options.locals = options;
	      cb(null, engine.render(str, options).trimLeft());
	    } catch (err) {
	      cb(err);
	    }
	  });
	};

What is actually happening?

Module not found: Error: Can't resolve 'velocityjs'

System Info

No response

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions