Describe the bug
Copying the ol-map sample fires this error
[Error] Unhandled Promise Rejection: TypeError: null is not an object (evaluating 'currentRenderingInstance.isCE')
logError (runtime-core.esm-bundler.js:6664)
handleError (runtime-core.esm-bundler.js:305)
callWithErrorHandling (runtime-core.esm-bundler.js:259)
flushJobs (runtime-core.esm-bundler.js:483)
promiseReactionJob
To Reproduce
Steps to reproduce the behavior:
- clone my sample repository https://github.com/eltorio/hello-openlayers.git
- yarn install && yarn serve
- goes to http://127.0.0.1:8080/
- See error
Expected behavior
Display a full width map and height 400px
package.json
{
"name": "hello-openlayers",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"@fortawesome/fontawesome-free": "5.15.3",
"@popperjs/core": "2.9.1",
"@tailwindcss/forms": "0.2.1",
"@vue/compiler-sfc": "3.0.7",
"chart.js": "2.9.4",
"core-js": "3.9.1",
"gulp": "4.0.2",
"gulp-append-prepend": "1.0.8",
"tailwindcss": "2.0.4",
"vue": "3.0.7",
"vue-router": "4.0.5",
"vue3-openlayers": "^0.1.55"
},
"devDependencies": {
"@babel/core": "7.13.10",
"@babel/eslint-parser": "7.13.10",
"@vue/cli-plugin-babel": "5.0.0-alpha.7",
"@vue/cli-plugin-eslint": "5.0.0-alpha.7",
"@vue/cli-service": "5.0.0-alpha.7",
"autoprefixer": "10.2.5",
"eslint": "7.22.0",
"eslint-plugin-vue": "7.7.0",
"postcss": "8.2.8",
"vue-template-compiler": "2.6.12"
},
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/essential",
"eslint:recommended"
],
"rules": {},
"parserOptions": {
"parser": "@babel/eslint-parser"
}
},
"postcss": {
"plugins": {
"autoprefixer": {}
}
},
"browserslist": [
"> 1%",
"last 2 versions"
]
}
**Vue **
<template>
<ol-map :loadTilesWhileAnimating="true" :loadTilesWhileInteracting="true" style="height:400px">
<ol-view ref="view" :center="center" :rotation="rotation" :zoom="zoom"
:projection="projection" />
<ol-tile-layer>
<ol-source-osm />
</ol-tile-layer>
</ol-map>
</template>
<script>
import {
ref
} from 'vue'
export default {
setup() {
const center = ref([40, 40])
const projection = ref('EPSG:4326')
const zoom = ref(8)
const rotation = ref(0)
return {
center,
projection,
zoom,
rotation
}
},
}
</script>
main.js
import { createApp } from "vue";
import { createWebHistory, createRouter } from "vue-router";
// styles
import "@fortawesome/fontawesome-free/css/all.min.css";
import "@/assets/styles/tailwind.css";
// mouting point for the whole app
import App from "@/App.vue";
//vue3 openlayers
import OpenLayersMap from 'vue3-openlayers';
import 'vue3-openlayers/dist/vue3-openlayers.css';
import Test from "@/views/OpenLayers.vue";
// routes
const routes = [
{
path: "/",
component: Test,
},
{ path: "/:pathMatch(.*)*", redirect: "/" },
];
const router = createRouter({
history: createWebHistory(),
routes,
});
const app = createApp(App);
app.use(router);
app.use(OpenLayersMap);
app.mount("#app");