Skip to content

Cannot use this package with nextjs #299

@THRY

Description

@THRY

Hi, im trying to use this package within nextjs and i get an error.

I am installing the package like described in the FAQ-Section (How can I import this library as ES module?):
const controlElevation = L.control.elevation({srcFolder: '/leaflet-elevation/src/' }).addTo(map);

Where the path in srcFolder points to the public nextjs folder, where i copied the package into.

I still get this error:

client.ts:59 ./node_modules/@raruto/leaflet-elevation/src/control.js:229:32
Module not found
  227 | 			case this.__LHOTLINE:    condition = typeof L.Hotline  !== 'function'; break;
  228 | 		}
> 229 | 		return condition !== false ? import(_.resolveURL(src, this.options.srcFolder)) : Promise.resolve();
      | 		                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  230 | 	},
  231 |
  232 | 	/**

Can you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions